8.3: Completing the Square
( \newcommand{\kernel}{\mathrm{null}\,}\)
In Introduction to Radical Notation, we showed how to solve equations such as x2=9 both algebraically and graphically.
x2=9x=±3

Note that when we take the square root of both sides of this equation, there are two answers, one negative and one positive.
A perfect square is nice, but not required. Indeed, we may even have to factor out a perfect square to put our final answer in simple form.
x2=8x=±√8x=±√4√2x=±2√2

Readers should use their calculators to check that −2√2≈−2.8284 and 2√2≈2.8284.
Now, let’s extend this solution technique to a broader class of equations.
Example 8.3.1
Solve for x:(x−4)2=9
Solution
Much like the solutions of x2=9 are x=±3, we use a similar approach on (x−4)2=9 to obtain:
(x−4)2=9 Original equation. x−4=±3 There are two square roots.
To complete the solution, add 4 to both sides of the equation.
x=4±3 Add 3 to both sides.
Note that this means that there are two answers, namely:
x=4−3x=1
or
x=4+3x=7
Check: Check each solution by substituting it into the original equation.
Substitute 1 for x:
(x−4)2=9(1−4)2=9(−3)2=9
Substitute 7 for x:
(x−4)2=9(7−4)2=9(3)2=9
Because the last statement in each check is a true statement, both x=1 and x=7 are valid solutions of (x−4)2=9.
Exercise 8.3.1
Solve for x:(x+6)2=10
- Answer
-
−2, −10
In Example 8.3.1, the right-hand side of the equation (x−4)2=9 was a perfect square. However, this is not required, as the next example will show.
Example 8.3.2
Solve for x:(x+5)2=7
Solution
Using the same technique as in Example 8.3.1, we obtain:
(x+5)2=7 Original equation. x+5=±√7 There are two square roots.
To complete the solution, subtract 5 from both sides of the equation.
x=−5±√7 Subtract 5 from both sides.
Note that this means that there are two answers, namely:
x=−5−√7 or x=−5+√7
Check: Check each solution by substituting it into the original equation.
Substitute −5−√7 for x:
(x+5)2=7((−5−√7)+5)2=7(−√7)2=7
Substitute −5+√7 for x:
(x+5)2=7((−5+√7)+5)2=7(√7)2=7
Because the last statement in each check is a true statement, both x=−5−√7 and x=−5+√7 are valid solutions of (x+5)2=7.
Exercise 8.3.2
Solve for x:(x−4)2=5
- Answer
-
4+√5,4−√5
Sometimes you will have to factor out a perfect square to put your answer in simple form.
Example 8.3.3
Solve for x:(x+4)2=20
Solution
Using the same technique as in Example 8.3.1, we obtain:
(x+4)2=20 Original equation. x+4=±√20 There are two square roots. x+4=±√4√5 Factor out a perfect square. x+4=±2√5 Simplify: √4=2
To complete the solution, subtract 4 from both sides of the equation.
x=−4±2√5 Subtract 4 from both sides.
Note that this means that there are two answers, namely:
x=−4−2√5 or x=−4+2√5
Check: Although it is possible to check the exact answers, let’s use our calculator instead. First, store −4−2√5 in X. Next, enter the left-hand side of the equation (x+4)2=20 (see image on the left in Figure 8.3.3). Note that (x+4)2 simplifies to 20, showing that −4−2√5 is a solution of (x+4)2=20.
In similar fashion, the solution −4+2√5 also checks in (x+4)2=20 (see image on the right in Figure 8.3.3).

Exercise 8.3.3
Solve for x:(x+7)2=18
- Answer
-
−7+3√2,−7−3√2
Perfect Square Trinomials Revisited
Recall the squaring a binomial shortcut.
Squaring a Binomial
If a and b are any real numbers, then: (a±b)2=a2±2ab+b2That is, you square the first term, take the product of the first and second terms and double the result, then square the third term.
Reminder examples:
(x+3)2=x2+2(x)(3)+32=x2+6x+9
(x−8)2=x2−2(x)(8)+82=x2−16x+64
Because factoring is “unmultiplying,” it is a simple matter to reverse the multiplication process and factor these perfect square trinomials.
x2+6x+9=(x+3)2
x2−16x+64=(x−8)2
Note how in each case we simply take the square root of the first and last terms.
Example 8.3.4
Factor each of the following trinomials:
- x2−12x+36
- x2+10x+25
- x2−34x+289
Solution
Whenever the first and last terms of a trinomial are perfect squares, we should suspect that we have a perfect square trinomial.
- The first and third terms of x2−12x+36 are perfect squares. Hence, we take their square roots and try:x2−12x+36=(x−6)2Note that 2(x)(6)=12x, which is the middle term on the left. The solution checks.
- The first and third terms of x2+10x+25 are perfect squares. Hence, we take their square roots and try:x2+10x+25=(x+5)2Note that 2(x)(5)=10x, which is the middle term on the left. The solution checks.
- The first and third terms of x2−34x+289 are perfect squares. Hence, we take their square roots and try:x2−34x+289=(x−17)2Note that 2(x)(17)=34x, which is the middle term on the left. The solution checks.
Exercise 8.3.4
Factor: x2+30x+225
- Answer
-
(x+15)2
Completing the Square
In this section we start with the binomial x2+bx and ask the question “What constant value should we add to x2+bx so that the resulting trinomial is a perfect square trinomial?” The answer lies in this procedure.
Completing the square
To calculate the constant required to make x2+bx a perfect square trinomial:
- Take one-half of the coefficient of x:b2
- Square the result of step one: (b2)2=b24
- Add the result of step two to x2+bx:x2+bx+b24
If you follow this process, the result will be a perfect square trinomial which will factor as follows:
x2+bx+b24=(x+b2)2
Example 8.3.5
Given x2+12x, complete the square to create a perfect square trinomial.
Solution
Compare x2+12x with x2+bx and note that b=12.
- Take one-half of 12:6
- Square the result of step one: 62=36
- Add the result of step two to x2+12x:x2+12x+36
Check: Note that the first and last terms of x2+12x+36 are perfect squares. Take the square roots of the first and last terms and factor as follows:
x2+12x+36=(x+6)2
Note that 2(x)(6)=12x, so the middle term checks.
Exercise 8.3.5
Given x2+16x, complete the square to create a perfect square trinomial.
- Answer
-
x2+16x+64=(x+8)2
Example 8.3.6
Given x2−3x, complete the square to create a perfect square trinomial.
Solution
Compare x2−3x with x2+bx and note that b=−3.
- Take one-half of −3:−32
- Square the result of step one: (−32)2=94
- Add the result of step two to x2−3x:x2−3x+94
Check: Note that the first and last terms of x2−3x+94 are perfect squares. Take the square roots of the first and last terms and factor as follows:
x2−3x+94=(x−32)2
Note that 2(x)(32)=3x, so the middle term checks.
Exercise 8.3.6
Given x2−5x, complete the square to create a perfect square trinomial.
- Answer
-
x2−5x+104=(x−52)2
Solving Equations by Completing the Square
Consider the following nonlinear equation.
x2=2x+2
The standard approach is to make one side zero and factor.x2−2x−2=0 However, one quickly realizes that there is no integer pair whose product is ac=−2 and whose sum is b=−2. So, what does one do in this situation? The answer is “Complete the square.”
Example 8.3.7
Use completing the square to help solve x2=2x+2.
Solution
First, move 2x to the left-hand side of the equation, keeping the constant 2 on the right-hand side of the equation.x2−2x=2On the left, take one-half of the coefficient of x:(12)(−2)=−1. Square the result: (−1)2=1. Add this result to both sides of the equation.
x2−2x+1=2+1x2−2x+1=3
We can now factor the left-hand side as a perfect square trinomial.
(x−1)2=3
Now, as in Examples 8.3.1, 8.3.2, and 8.3.3, we can take the square root of both sides of the equation. Remember, there are two square roots.
x−1=±√3
Finally, add 1 to both sides of the equation.
x=1±√3
Thus, the equation x2=2x+2 has two answers, x=1−√3 and x=1+√3.
Check: Let’s use the calculator to check the solutions. First, store 1−√3 in X (see the image on the left in Figure 8.3.4). Then enter the left- and right-hand sides of the equation x2=2x+2 and compare the results (see the image on the left in Figure 8.3.4). In similar fashion, check the second answer 1+√3 (see the image on the right in Figure 8.3.4).

In both cases, note that the left- and right-hand sides of x2=2x+2 produce the same result. Hence, both 1−√3 and 1+√3 are valid solutions of x2=2x+2.
Exercise 8.3.7
Use completing the square to help solve x2=3−6x.
- Answer
-
−3+2√3,−3−2√3
Example 8.3.8
Solve the equation x2−8x−12=0, both algebraically and graphically. Compare your answer from each method.
Solution
First, move the constant 12 to the right-hand side of the equation.
x2−8x−12=0 Original equation. x2−8x=12 Add 12 to both sides.
Take half of the coefficient of x:(1/2)(−8)=−4. Square: (−4)2=16. Now add 16 to both sides of the equation.
x2−8x+16=12+16 Add 16 to both sides. (x−4)2=28 Factor left-hand side. x−4=±√28 There are two square roots.
Note that the answer is not in simple radical form.
x−4=±√4√7 Factor out a perfect square. x−4=±2√7 Simplify: √4=2x=4±2√7 Add 4 to both sides.
Graphical solution: Enter the equation y=x2−8x−12 in Y1 of the Y= menu (see the first image in Figure 8.3.5). After some experimentation, we settled on the WINDOW parameters shown in the middle image of Figure 8.3.5. Once you’ve entered these WINDOW parameters, push the GRAPH button to produce the rightmost image in Figure 8.3.5.

We’re looking for solutions of x2−8x−12=0, so we need to locate where the graph of y=x2−8x−12 intercepts the x-axis. That is, we need to find the zeros of y=x2−8x−12. Select 2:zero from the CALC menu, move the cursor slightly to the left of the first x-intercept and press ENTER in response to “Left bound.” Move the cursor slightly to the right of the first x-intercept and press ENTER in response to “Right bound.” Leave the cursor where it sits and press ENTER in response to “Guess.” The calculator responds by finding the x-coordinate of the x-intercept, as shown in the first image in Figure 8.3.6.
Repeat the process to find the second x-intercept of y=x2−8x−12 shown in the second image in Figure 8.3.6.

Reporting the solution on your homework: Duplicate the image in your calculator’s viewing window on your homework page. Use a ruler to draw all lines, but freehand any curves.
- Label the horizontal and vertical axes with x and y, respectively (see Figure 8.3.7).
- Place your WINDOW parameters at the end of each axis (see Figure 8.3.7).
- Label the graph with its equation (see Figure 8.3.7).
- Drop dashed vertical lines through each x-intercept. Shade and label the x-values of the points where the dashed vertical line crosses the x-axis. These are the solutions of the equation x2−8x−12=0 (see Figure 8.3.7).

Thus, the graphing calculator reports that the solutions of x2−8x−12=0 are x≈−1.291503 and x≈9.2915026.
Comparing exact and calculator approximations: How well do the graphing calculator solutions compare with the exact solutions, x=4−2√7 and x=4+2√7? After entering each in the calculator (see Figure 8.3.8), the comparison is excellent!

Exercise 8.3.8
Solve the equation x2+6x+3=0 both algebraically and graphically, then compare your answers.
- Answer
-
−3−√6,−3+√6