Completing the Square

Completing the square is when a quadratic of the form ax^2+bx+c is rewritten in the form \alpha(x+\beta)^2+\gamma.

Let us consider the simpler case where a=1.

Example 1: Write x^2+4x+9 in form (x+a)^2+b.
Take the coefficient of x in the original quadratic (this is 4) and halve it – see what happens when you choose a to be this value and expand (x+a)^2:


Now we can see why we should halve the number as you end up with two lots of it in the expansion.
The result is x^2+4x+4 but we want x^2+4x+9 and so we must add 5 to this to get x^2+4x+9. It follows that:


We can also think of x^2+4x as (x+2)^2-4 and adding 9 to both obtains the required result.

We now consider an example of completing the square where a\ne 1.

Example 2 – Write 2x^2+8x-5 in the form p(x+q)^2+r.

Students often get confused with this more complicated example. It can be made simpler to first taking out a factor of 2 and completing the square of what’s inside the brackets:


The final term can be expanded as follows to obtain the result as required: