This method is known as completing the square. To find the constant a, we must halve the coefficient of x, which in this case is 4. This is to compensate for the double term when expanding the brackets. So a=4/2 =2. To find b, we subtract a^2 from the constant at the end of the expression, which in this case is -12. This is to compensate for the extra a^2 term that will appear once expanding the brackets. So b = -12 -2^2 = -12-4 =-16.