Completing the square is the process of rewriting a quadratic expression from the expanded form $x^2+2bx+c$x2+2bx+c into the square form $\left(x+b\right)^2+cb^2$(x+b)2+c−b2. The name comes from how the method was first performed by ancient Greek mathematicians who were actually looking for numbers to complete a physical square.
There are two ways to think about the completing the square method: visually (using a square), and algebraically. We will see that we can use this method to find the solutions to the quadratic equation and to more easily graph the function.
The basis for completing the square relies on the factoring technique for perfect square trinomials.
A perfect square trinomial is of the form $a^2+2ab+b^2$a2+2ab+b2 and factors to give $\left(a+b\right)^2$(a+b)2
For the most part, we will be using that:
$x^2+2bx+b^2=\left(x+b\right)^2$x2+2bx+b2=(x+b)2
or
$x^2+bx+\left(\frac{b}{2}\right)^2=\left(x+\frac{b}{2}\right)^2$x2+bx+(b2)2=(x+b2)2
Let's practice factoring perfect square trinomials before we start completing the square.
Complete the distribution of the perfect square: $\left(x3\right)^2$(x−3)2
$\left(x3\right)^2=x^2\editable{}x+\editable{}$(x−3)2=x2−x+
Factor $x^212x+36$x2−12x+36.
Factor $x^216x+64$x2−16x+64.
Consider the following quadratics:
$x^2+4x5$x2+4x−5
$x^2+2x3$x2+2x−3
$x^28x20$x2−8x−20
Let's imagine we want to factor them using the complete the square method. Now, none of these are perfect square trinomials, but we are going to add or subtract a constant to make it a perfect square trinomial.
The steps involved are:
As this is a visual method, its best to learn by watching the process in action, so here are two examples.
We wish to factor $x^2+4x5$x2+4x−5 by first completing the square.
Completing the square on $x^2+4x5$x2+4x−5:
Then can also show this algebraically.
$x^2+4x5$x2+4x−5  $=$=  $x^2+4x+445$x2+4x+4−4−5 
$=$=  $\left(x+2\right)^245$(x+2)2−4−5  
$=$=  $\left(x+2\right)^29$(x+2)2−9 
We wish to factor $x^28x20=0$x2−8x−20=0 by first completing the square.
Completing the square on $x^28x20$x2−8x−20:
We can also factor this algebraically.
$x^28x20$x2−8x−20  $=$=  $x^28x+161620$x2−8x+16−16−20 
$=$=  $\left(x4\right)^21620$(x−4)2−16−20  
$=$=  $\left(x4\right)^236$(x−4)2−36 
This interactive will help you to visualize the process. Watch this video for an explanation .
Let's imagine we want to factor the same quadratics as before, but this time using the algebraic version of the complete the square method.
Suppose we wanted to complete the square for $x^28x+13$x2−8x+13. If we complete the square, we want to get it to the form $\left(xh\right)^2+k$(x−h)2+k.
The first question is, what will the value of $h$h, the constant in the parentheses, be?
$x^28x+13=\left(xh\right)^2+k$x2−8x+13=(x−h)2+k
If we go back to the idea that $x^2+2bx+b^2=\left(x+b\right)^2$x2+2bx+b2=(x+b)2, we will notice that the constant in the parentheses is half of the coefficient of the linear term. The constant in the parentheses is therefore $\frac{8}{2}$−82, which is $4$−4.
$x^28x+13=\left(x4\right)^2+k$x2−8x+13=(x−4)2+k
Now we need to determine what the value of $k$k will be. To do that, let's consider what $\left(x4\right)^2$(x−4)2 distributes out to.
$\left(x4\right)^2=x^28x+16$(x−4)2=x2−8x+16
Notice that we already had the $x^2$x2 and the $8x$−8x terms, but we had $+13$+13, not $+16$+16 as our coefficient. To account for this, we will add and subtract $16$16, to get what we need, while keeping everything balanced.
$x^28x+13=x^28x+1616+13$x2−8x+13=x2−8x+16−16+13
Now, by collecting like terms, we are all done!
$x^28x+13$x2−8x+13  $=$=  $x^28x+1616+13$x2−8x+16−16+13 
Adding and subtracting $\left(\frac{8}{2}\right)^2=16$(−82)2=16 
$=$=  $\left(x^28x+16\right)16+13$(x2−8x+16)−16+13 
Consider that we have now created a Perfect Square Trinomials 

$=$=  $\left(x4\right)^216+13$(x−4)2−16+13 
Factor the first three terms 

$=$=  $\left(x4\right)^23$(x−4)2−3 
Combine Like Terms 
The steps involved are:
What should be added to $x^2x$x2−x to make it a perfect square?
Using the method of completing the square, rewrite $x^2+3x+6$x2+3x+6 in the form $\left(x+b\right)^2+c$(x+b)2+c.
Using the method of completing the square, rewrite $x^27x+14$x2−7x+14 in the form $\left(x+b\right)^2+c$(x+b)2+c.