Section 2.5 Completing the Square

Essential Review

Expand $(x+9)^2$

The really important thing to remember here is that we can't "distribute" a square over addition. When we see that little exponent of 2, we need to think of that as telling us to multiply $x+9$ by itself: $$(x+9)^2 = (x+9)(x+9).$$ From there we use distribution (aka FOIL) to expand: $$(x+9)(x+9) = x\cdot x + 9x + 9x + 9\cdot 9$$ $$=x^2 + 18x + 81$$


Factor $x^2 - 14x + 49$

We could use our "$ac$" method here, or we could maybe recognize a special pattern. Notice that 14 is $7\cdot 2$ and 49 is $7^2$; this is a perfect square trinomial! Therefore, we can factor it as follows: $$x^2 - 14x + 49 = (x-7)(x-7) = (x-7)^2.$$


Factor $5x^2 + 40x + 80$

Here, we first notice that 5, 40, and 80 have a common factor of 5. Let's factor that out first and see where we can go from there.

$$5x^2 + 40x + 80 = 5(x^2 + 8x + 16)$$

Now, we see again that 8 is $4\cdot 2$ and 16 is $4^2$, so $x^2 + 8x + 16$ is another perfect square trinomial. Therefore, our final factorization is $$5(x+8)^2$$


In this section, we're going to make use of the patterns we see above in a new way. This will allow us to solve quadratics in a new way, and eventually it will help us to reveal hidden information about equations.

Completing The Square

Before we get into this technique, we need to work on some pattern recognition. Let's square some binomials.

$$(x+9)^2$$ $$(x+9)(x+9)$$ $$x^2 + 9x + 9x + 81$$ $$x^2 + 9x + 81$$

What we see is that the middle $bx$ term is twice the original 9, and the ending $c$ term is the square of 9. We're going to make use of that pattern to create perfect square trinomials when we don't already have one.

Binomial Squares Pattern

If $n$ is a real number, $$(x+n)^2 = x^2 + \textcolor{Maroon}{2n}x + \textcolor{Blue}{n^2}.$$


Now, our new goal is to "make" a perfect square trinomial.

Rewrite $x^2 + 6x$ in the form $(x+n)^2 + m$.

Our first goal is to identify what our $n$ should be. We only have two terms, $x^2$ and $6x$. When we match this up to our binomial squares pattern, we see $$\begin{array}{ccc} x^2 & + \textcolor{Maroon}{6}x & \\ x^2 & +\textcolor{Maroon}{2n}x& +\textcolor{Blue}{n^2}\\ \end{array}$$

When we line up our terms, we see that our $2n$ and $6$ match up. If we let $2n = 6$, we see that $n$ needs to be 3. That makes the missing $n^2$ term $3^2 = 9$.

However, we can't just add a 9 onto the end of our expression, because that would completely change it! The expression $x^2 + 6x$ is different from $x^2 + 6x + 9$. What we're always allowed to add, though, is a fancy form of zero. So, we'll add $+9-9$ to the end of our expression.

$$x^2 + 6x = x^2 + 6x + 9 - 9$$

Now, we'll factor the perfect square portion of our expression, and leave the extra -9 at the end!

$$x^2 + 6x = (x+3)^2 - 9$$

Let's recap what just happened in that example before moving on.

Completing the square for $x^2 + bx$

Goal: Write in the form $(x+n)^2 + m$

  1. To identify $n$, let $b = 2n$ and solve.
  2. Add $n^2 - n^2$ to the end of the expression (a fancy form of zero!).
  3. Factor the perfect square portion of the expression, leaving the $-n^2$ alone at the end.

Write in the form $(x+n)^2 + m$ by completing the square.

$$x^2 - 26x$$

Let's line things up again.

$$\begin{array}{ccc} x^2 & \textcolor{Maroon}{-26}x &\\ x^2 & \textcolor{Maroon}{+2n}n & +\textcolor{Blue}{n^2}\\ \end{array}$$

Here we see $2n = -26$, so $n = -13$. That makes $n^2 = (-13)^2 = 169$, so we'll add $169-169$ (our fancy form of zero) to the end of our expression, then factor the perfect square part, leaving the -169 at the end.

$$x^2 -26x + 169 - 169$$ $$ =(x-13)^2 - 169$$

Write in the form $(x+n)^2 + m$ by completing the square.

$$x^2 - 9x$$

Let's line things up again.

$$\begin{array}{ccc} x^2 & \textcolor{Maroon}{-9}x &\\ x^2 & \textcolor{Maroon}{+2n}n & +\textcolor{Blue}{n^2}\\ \end{array}$$

Here we see $2n = -9$, so $n = -\frac92$. It's not pretty, but that makes $n^2 = \left(-\frac92\right)^2 = \frac{81}4$, so we'll add $\frac{81}4-\frac{81}4$ (our fancy form of zero) to the end of our expression, then factor the perfect square part, leaving the $-\frac{81}4$ at the end.

$$x^2 -9x + \frac{81}4-\frac{81}4$$

Now, the factoring seems especially tricky, but remember the pattern we're using! We want to end up with $(x+n)^2$ for the factored portion, and we already figured out that $n = -\frac92$. So, our final factored answer should be $$\left(x-\frac92\right)^2 -\frac{81}4.$$


Solving Quadratics by Completing the Square

One reason we might want to complete the square is to solve a quadratic. This strategy is actually necessary to derive the handy dandy quadratic formula! Let's see it in action.

Solve $x^2 + 6x = 40$ by completing the square.

First, we'll work on completing the square for the $x^2 + 6x$ terms. Using previous examples, we'll see that $n = 3$, so $n^2 = 9$, and we'll have: $$\begin{align*} x^2 + 6x &= 40\\ x^2 + 6x + 9-9 &= 40\\ (x+3)^2 - 9 &= 40\\ \end{align*}$$ Now this equation is nicely set up to use the square root strategy, if we move the 9 to the other side. $$\begin{align*} (x+3)^2 &= 49\\ \sqrt{(x+3)^2} &= \sqrt{49}\\ x+3 &= \pm 7\\ \end{align*}$$ We finish this up by solving $x+3 = 7$ and $x + 3 = -7$, for solutions of $x = 4$ and $x = -10$, respectively.


Solve $x^2 + 8x = 48$ by completing the square

First, we'll work on completing the square for the $x^2 + 8x$ terms. Using previous examples, we'll see that $n = 4$, so $n^2 = 16$, and we'll have: $$\begin{align*} x^2 + 8x &= 48\\ x^2 + 8x + 16-16 &= 48\\ (x+4)^2 - 16 &= 48\\ \end{align*}$$ Now this equation is nicely set up to use the square root strategy, if we move the 16 to the other side. $$\begin{align*} (x+4)^2 &= 64\\ \sqrt{(x+4)^2} &= \sqrt{64}\\ x+4 &= \pm 8\\ \end{align*}$$ We finish this up by solving $x+4 = 8$ and $x + 4 = -8$, for solutions of $x = 4$ and $x = -12$, respectively.



Completing the Square when $a \neq 1$

So far, we've been looking at the best case scenarios. What happens when there's a leading coefficient of something other than 1, like this? $$3x^2 - 12x$$

In this case, we'll need to do a little extra factoring before we can proceed (carefully).

Write $3x^2 - 12x$ in the form $a(x+n)^2 + m$ by completing the square.

Before we can make use of our $(x+n)^2$ pattern, we need to factor out the leading 3: $$3x^2 - 12x = 3(x^2 - 4x)$$

Now, we're going to match the $x^2 -4x$ portion of our expression up with the $x^2 + 2nx + n^2$ pattern, but we're going to keep that factored 3 in mind as we do.

$$\begin{array}{rccc} 3 & (x^2 & \textcolor{Maroon}{-4}x & ~~)\\ & (x^2 & \textcolor{Maroon}{+2n}x & +\textcolor{Blue}{n^2})\\ \end{array}$$

Now we see that $2n = -4$, so $n = -2$. Here is where we need to be careful. Our $n^2$ is still $(-2)^2 = 4$, but when we add our fancy zero, $4-4$, that's all inside our parentheses, being multiplied by a 3 on the outside: $$3(x^2 -4x + 4 -4).$$

Now, we'll factor the perfect square portion, and see what we have left.

$$3((x-2)^2 -4)$$

If we distribute the 3, we have $$3(x-2)^2 - 3\cdot 4 = 3(x-2)^2 -12$$ for our final answer.


That's a little more tricky. Let's try another example.

Write $4x^2 - 24x$ in the form $a(x+n)^2 + m$ by completing the square.

Before we can make use of our $(x+n)^2$ pattern, we need to factor out the leading 4: $$4x^2 - 24x = 4(x^2 - 6x)$$

Now, we're going to match the $x^2 -6x$ portion of our expression up with the $x^2 + 2nx + n^2$ pattern, but we're going to keep that factored 4 in mind as we do.

$$\begin{array}{rccc} 4 & (x^2 & \textcolor{Maroon}{-6}x & ~~)\\ & (x^2 & \textcolor{Maroon}{+2n}x & +\textcolor{Blue}{n^2})\\ \end{array}$$

Now we see that $2n = -6$, so $n = -3$. Here is where we need to be careful. Our $n^2$ is still $(-3)^2 = 9$, but when we add our fancy zero, $9-9$, that's all inside our parentheses, being multiplied by a 4 on the outside: $$4(x^2 -6x + 9-9).$$

Now, we'll factor the perfect square portion, and see what we have left.

$$4((x-3)^2 -9)$$

If we distribute the 4, we have $$4(x-3)^2 - 9\cdot 4 = 4(x-3)^2 -36$$ for our final answer.


Solve by completing the square.

$$2x^2 + 16x + 14 = 0$$

Start by factoring out the 2 from only the first terms. Remember, the 14 isn't really involved in completing the square; we're only concerned about the $ax^2$ and $bx$ terms.

$$2x^2 + 16x + 14 = 0$$ $$2(x^2 + 8x + ~~~) + 14 = 0$$

Now, we want to complete the square for $x^2 + 8x$. We see that $2n = 8$, so $n = 4$ and $n^2 = 16$. Then we add $16 -16$ inside our parentheses.

$$2(x^2 + 8x + 16 - 16) + 14 = 0$$

Factor, then simplify, and we have $$2((x+4)^2 -16) + 14 = 0$$ $$2(x+4)^2 - 2\cdot 16 + 14 = 0$$ $$2(x+4)^2 -18 = 0$$

This equation is ready for solving via square roots. We'll move the 18 to the other side of the equals sign, then divide by 2, then root both sides to undo the square.

$$2(x+4)^2 = 18$$ $$(x+4)^2 = 9$$ $$\sqrt{(x+4)^2} = \sqrt{9}$$ $$x+4 = 9 \text{ or } x + 4 = -9$$ $$x = 5 \text{ or } x = -13$$

Solve by completing the square.

$$2x^2 - 3x = 20$$

Start by factoring out the 2 from the terms on the left hand side. This feels a little weird, since 2 isn't a factor of 3. Keep in mind that factoring out a common factor is kind of like dividing each term by that factor.

$$2x^2 -3x = 20$$ $$2(x^2 - \frac32 x + ~~~) = 20$$

Now, we want to complete the square for $x^2 -\frac32 x$. We see that $2n = -\frac32$, so $n = -\frac34$ and $n^2 = \frac9{16}$. Then we add $\frac9{16}-\frac9{16}$ inside our parentheses.

$$2(x^2 -\frac32x +\frac9{16}-\frac9{16}) = 20$$

Factor (remembering that our $n=\frac34$, then simplify, and we have $$2((x-\frac34)^2 -\frac9{16})= 20$$ $$2(x-\frac34)^2 - 2\cdot \frac9{16} = 20$$ $$2(x-\frac34)^2 - \frac98 = 20$$

This equation is ready for solving via square roots. We'll move the $\frac98$ to the other side of the equals sign, then divide by 2, then root both sides to undo the square.

$$2(x-\frac34)^2 = \frac{169}{8}$$ $$(x-\frac34)^2 = \frac{169}{16}$$ $$\sqrt{(x-\frac34)^2} = \sqrt{\frac{169}{16}}$$ $$x-\frac34 = \frac{13}{4} \text{ or } x - \frac34 = -\frac{13}{4}$$ $$x = \frac{16}{4} \text{ or } x = -\frac{10}{4}$$ $$x=4, -\frac52$$


Section 2.5 Exercises

Conceptual Questions

  1. Describe the process of completing the square when $a=1.$
  2. Describe the process of completing the square when $a\neq 1.$

Practice Problems

In the following exercises, complete the square to make a perfect square trinomial. Then write the result in the form $(x+n)^2 + m$.

  1. $x^2 - 24x$
  2. $x^2 - 11x$
  3. $x^2 -\frac13 x$
  4. $x^2 - 16x$
  5. $ x^2 + 15x$
  6. $x^2 + \frac34 x$
  1. $x^2 - 22x$
  2. $2x^2 + 10x$
  3. $5 x^2 + 2x$
  4. $ 3x^2 - 18x$
  5. $4x^2 - 28x$
  6. $3x^2 - 2x$
  1. $(x−12)^{2}-144$

  1. $\left( x - \frac{1}{6} \right)^{2} - \frac{1}{36}$

  1. $\left( x + \frac{15}{2} \right)^{2} - \frac{225}{4}$

  1. $(x−11)^{2}-121$

  1. $5\left( x + \frac{1}{5} \right)^{2} - \frac{1}{5}$

  1. $4\left( x - \frac{7}{2} \right)^{2} - 49$



In the following exercises, solve by completing the square.

  1. $x^2 + 2x = 3$
  2. $x^2 + 12x = -11$
  3. $x^2 - 20x - 21 = 0$
  4. $x^2 - 8 = 2x$
  5. $x^2 + 4x = -44$
  6. $x^2 = 2x - 3$
  7. $x^2 + 5x = 2$
  8. $x^2 - 3x - 2 = 0$
  9. $x^2 - 14x + 12 = -1$
  10. $x^2 = 9x + 2$
  11. $x^2 = 5x-1$
  12. $x^2 - 5 = 10x$
  13. $x^2-14 = 6x$
  1. $3x^2 + 30x - 27 = 6$
  2. $2x^2 - 14x + 12 = 0$
  3. $2x^2 + 4x = 26$
  4. $5x^2 + 20x = 15$
  5. $2x^2 + x = 6$
  6. $3x^2 - 4x = 15$
  7. $2x^2 + 7x - 15 = 0$
  8. $3x^2 - 14x + 8 = 0$
  9. 2x^2 + 7x = 14$
  10. $3x^2 - 5x = 9$
  11. $5x^2 - 3x = -10$
  12. $7x^2 + 4x = -3$
  1. $x = -3, 1$

  1. $x = -1, 21$

  1. No real solutions

  1. $x = - \frac{5}{2} \pm \frac{\sqrt{33}}{2}$

  1. $x = 1, 13$

  1. $x = \frac{5}{2} \pm \frac{\sqrt{21}}{2}$

  1. $x = 3 \pm \sqrt{23}$

  1. $x = 1, 6$

  1. $x = - 2 \pm \sqrt{7}$

  1. $x = - \frac{5}{3},3$

  1. $x = \frac{2}{3},4$

  1. $x = \frac{5}{6} \pm \frac{\sqrt{133}}{6}$

  1. No real solutions




  1. Solve the equation $x^2 + 10x = -25$...
    1. by factoring
    2. by completing the square
    3. Which method do you prefer? Why?