Solving quadratics by completing the square

For example, solve x²+6x=-2 by manipulating it into (x+3)²=7 and then taking the square root.

What you should be familiar with before taking this lesson

What you will learn in this lesson

So far, you've either solved quadratic equations by taking the square root or by factoring. These methods are relatively simple and efficient, when applicable. Unfortunately, they are not always applicable.
In this lesson, you will learn a method for solving any kind of quadratic equation.

Solving quadratic equations by completing the square

Consider the equation x2+6x=2x^2+6x=-2. The square root and factoring methods are not applicable here.
You can't just take the square root of both sides because the equation includes xx raised to the first power.
Furthermore, you simply can't factor x2+6x+2x^2+6x+2 as the product of two neat linear expressions. Try it yourself, it won't work.
But hope is not lost! We can use a method called completing the square. Let's start with the solution and then review it more closely.
(1)x2+6x=2(2)x2+6x+9=7Add 9, completing the square.(3)(x+3)2=7Factor the expression on the left.(4)(x+3)2=±7Take the square root.(5)x+3=±7(6)x=±73Subtract 3.\begin{aligned}(1)&&x^2+6x&=-2\\\\ \blueD{(2)}&&\Large\blueD{x^2+6x+9}&\Large\blueD{=7}&&\blueD{\text{Add 9, completing the square.}}\\\\ (3)&&(x+3)^2&=7&&\text{Factor the expression on the left.}\\\\ (4)&&\sqrt{(x+3)^2}&=\pm \sqrt{7}&&\text{Take the square root.}\\\\ (5)&&x+3&=\pm\sqrt{7}\\\\ (6)&&x&=\pm\sqrt{7}-3&&\text{Subtract 3.}\end{aligned}
In conclusion, the solutions are x=73x=\sqrt{7}-3 and x=73x=-\sqrt{7}-3.

What happened here?

Adding 99 to x2+6xx^2+6x in row (2)\blueD{(2)} had the fortunate result of making the expression a perfect square that can be factored as (x+3)2(x+3)^2. This allowed us to solve the equation by taking the square root.
This was no coincidence, of course. The number 99 was carefully chosen so the resulting expression would be a perfect square.

How to complete the square

To understand how 99 was chosen, we should ask ourselves the following question: If x2+6xx^2+6x is the beginning of a perfect square expression, what should be the constant term?
Let's assume that the expression can be factored as the perfect square (x+a)2(x+a)^2 where the value of constant aa is still unknown. This expression is expanded as x2+2ax+a2x^2+2ax+a^2, which tells us two things:
  1. The coefficient of xx, which we know to be 66, should be equal to 2a2a. This means that a=3a=3.
  1. The constant number we need to add is equal to a2a^2, which is 32=93^2=9.
Try to complete a few squares on your own.
What is the missing constant term in the perfect square that starts with x2+10xx^2+10x ?
  • Your answer should be
  • an integer, like 66
  • a simplified proper fraction, like 3/53/5
  • a simplified improper fraction, like 7/47/4
  • a mixed number, like 1 3/41\ 3/4
  • an exact decimal, like 0.750.75
  • a multiple of pi, like 12 pi12\ \text{pi} or 2/3 pi2/3\ \text{pi}

We want to add a constant number to x2+10xx^2+\tealD{10}x so it is in the form x2+2ax+a2x^2+\tealD{2a}x+a^2. In that form, the coefficient of xx is 2a\tealD{2a}, and in our expression that coefficient is 10\tealD{10}. Therefore, 2a=10\tealD{2a}=\tealD{10}, which means a=5a=5.
The constant number we need to add to get to that form is a2a^2, which is 52=255^2=25. This way, the expression will be x2+10x+25x^2+10x+25 which is factored as (x+5)2(x+5)^2.
In conclusion, the constant we should add is 2525.
What is the missing constant term in the perfect square that starts with x22xx^2-2x ?
  • Your answer should be
  • an integer, like 66
  • a simplified proper fraction, like 3/53/5
  • a simplified improper fraction, like 7/47/4
  • a mixed number, like 1 3/41\ 3/4
  • an exact decimal, like 0.750.75
  • a multiple of pi, like 12 pi12\ \text{pi} or 2/3 pi2/3\ \text{pi}

We want to add a constant number to x22xx^2\tealD{-2}x so it is in the form x2+2ax+a2x^2+\tealD{2a}x+a^2. In that form, the coefficient of xx is 2a\tealD{2a}, and in our expression that coefficient is 2\tealD{-2}. Therefore, 2a=2\tealD{2a}=\tealD{-2} which means a=1a=-1.
The constant number we need to add to get to that form is a2a^2, which is (1)2=1(-1)^2=1. This way, the expression will be x22x+1x^2-2x+1, which is factored as (x1)2(x-1)^2.
In conclusion, the constant we should add is 11.
What is the missing constant term in the perfect square that starts with x2+12xx^2+\dfrac{1}{2}x ?
  • Your answer should be
  • a simplified proper fraction, like 3/53/5

We want to add a constant number to x2+12xx^2+\tealD{\dfrac{1}{2}}x so it is in the form x2+2ax+a2x^2+\tealD{2a}x+a^2. In that form, the coefficient of xx is 2a\tealD{2a}, and in our expression that coefficient is 12\tealD{\dfrac{1}{2}}. Therefore, 2a=12\tealD{2a}=\tealD{\dfrac{1}{2}}, which means a=14a=\dfrac{1}{4}.
The constant number we need to add to get to that form is a2a^2, which is (14)2=116\left(\dfrac{1}{4}\right)^2=\dfrac{1}{16}. This way, the expression will be x2+12x+116x^2+\dfrac{1}{2}x+\dfrac{1}{16}, which is factored as (x+14)2\left(x+\dfrac{1}{4}\right)^2.
In conclusion, the constant we should add is 116\dfrac{1}{16}.

Challenge question

What is the missing constant term in the perfect square that starts with x2+bxx^2+b\!\cdot\!\!x?
Choose 1 answer:
Choose 1 answer:

We want to add a constant number to x2+bxx^2+\tealD{b}\cdot x so it is in the form x2+2ax+a2x^2+\tealD{2a}x+a^2. In that form, the coefficient of xx is 2a\tealD{2a}, and in our expression that coefficient is b\tealD{b}. Therefore, 2a=b\tealD{2a}=\tealD{b}, which means a=b2a=\dfrac{b}{2}.
The constant number we need to add to get to that form is a2a^2, which is (b2)2\left(\dfrac{b}{2}\right)^2. This way, the expression will be x2+2b2x+(b2)2x^2+2\cdot\dfrac{b}{2}\cdot x+\left(\dfrac{b}{2}\right)^2, which is factored as (x+b2)2\left(x+\dfrac{b}{2}\right)^2.
In conclusion, the constant we should add is (b2)2\left(\dfrac{b}{2}\right)^2.
This challenge question gives us a shortcut to completing the square, for those that like shortcuts and don't mind memorizing things. It shows us that in order to complete x2+bxx^2+bx into a perfect square, where bb is any number, we need to add (b2)2\left(\dfrac{b}{2}\right)^2 to it.
For example, in order to complete x2+6xx^2+\blueD{6}x into a perfect square, we added (62)2=9\left(\dfrac{\blueD{6}}{2}\right)^2=9 to it.

Solving equations one more time

All right! Now that you're a certified square-completer, let's go back to the process of solving equations using our method.
Let's look at a new example, the equation x210x=12x^2-10x=-12.
(1)x210x=12(2)x210x+25=13Add 25, completing the square.(3)(x5)2=13Factor the expression on the left.(4)(x5)2=±13Take the square root.(5)x5=±13(6)x=±13+5Add 5.\begin{aligned}(1)&&x^2-10x&=-12\\\\ \blueD{(2)}&&\Large\blueD{x^2-10x+25}&\Large\blueD{=13}&&\blueD{\text{Add 25, completing the square.}}\\\\ (3)&&(x-5)^2&=13&&\text{Factor the expression on the left.}\\\\ (4)&&\sqrt{(x-5)^2}&=\pm \sqrt{13}&&\text{Take the square root.}\\\\ (5)&&x-5&=\pm\sqrt{13}\\\\ (6)&&x&=\pm\sqrt{13}+5&&\text{Add 5.}\end{aligned}
In order to make the original left-hand expression x210xx^2-10x a perfect square, we added 2525 in row (2)\blueD{(2)}. As always with equations, we did the same for the right-hand side, which made it increase from 12-12 to 1313.
In general, the choice of the number to add in order to complete the square doesn't depend on the right-hand side, but we should always add the number to both sides.
Now it's your turn to solve some equations.
Solve x28x=5x^2-8x=5.
Choose 1 answer:
Choose 1 answer:

x28x=5x28x+16=21Add 16, completing the square.)(x4)2=21Factor(x4)2=±21Take the square root.x4=±21x=±21+4Add 4.\begin{aligned}x^2-8x&=5\\\\ x^2-8x+16&=21&&\text{Add 16, completing the square.)}\\\\ (x-4)^2&=21&&\text{Factor}\\\\ \sqrt{(x-4)^2}&=\pm\sqrt{21}&&\text{Take the square root.}\\\\ x-4&=\pm\sqrt{21}\\\\ x&=\pm\sqrt{21}+4&&\text{Add 4.}\end{aligned}
In conclusion, the solutions are x=21+4x=\sqrt{21}+4 and 21+4-\sqrt{21}+4.
Solve x2+3x=14x^2+3x=-\dfrac{1}{4}.
Choose 1 answer:
Choose 1 answer:

x2+3x=14x2+3x+94=2Add 94, completing the square.(x+32)2=2Factor.(x+32)2=±2Take the square root.x+32=±2x=±232Subtract 32.\begin{aligned}x^2+3x&=-\dfrac{1}{4}\\\\ x^2+3x+\dfrac{9}{4}&=2&&\text{Add }\dfrac{9}{4}\text{, completing the square.}\\\\\\ \left(x+\dfrac{3}{2}\right)^2&=2&&\text{Factor.}\\\\\\ \sqrt{\left(x+\dfrac{3}{2}\right)^2}&=\pm\sqrt{2}&&\text{Take the square root.}\\\\\\ x+\dfrac{3}{2}&=\pm\sqrt{2}\\\\ x&=\pm\sqrt{2}-\dfrac{3}{2}&&\text{Subtract }\dfrac{3}{2}\text{.}\end{aligned}
In conclusion, the solutions are x=232x=\sqrt{2}-\dfrac{3}{2} and 232-\sqrt{2}-\dfrac{3}{2}.

Arranging the equation before completing the square

Rule 1: Separate the variable terms from the constant term

This is how the solution of the equation x2+5x6=x+1x^2+5x-6=x+1 goes:
(1)x2+5x6=x+1(2)x2+4x6=1Subtract x.(3)x2+4x=7Add 6.(4)x2+4x+4=11Add 4, completing the square.(5)(x+2)2=11Factor.(6)(x+2)2=±11Take the square root.(7)x+2=±11(8)x=±112Subtract 2.\begin{aligned}(1)&&x^2+5x-6&=x+1\\\\ \tealD{(2)}&&\tealD{x^2+4x-6}&\tealD{=1}&&\tealD{\text{Subtract }x.}\\\\ \purpleC{(3)}&&\purpleC{x^2+4x}&\purpleC{=7}&&\purpleC{\text{Add 6.}}\\\\ (4)&&x^2+4x+4&=11&&\text{Add 4, completing the square.}\\\\ (5)&&(x+2)^2&=11&&\text{Factor.}\\\\ (6)&&\sqrt{(x+2)^2}&=\pm\sqrt{11}&&\text{Take the square root.}\\\\ (7)&&x+2&=\pm\sqrt{11}\\\\ (8)&&x&=\pm\sqrt{11}-2&&\text{Subtract 2.}\end{aligned}
Completing the square on one of the equation's sides is not helpful if we have an xx-term on the other side. This is why we subtracted xx in row (2)\tealD{(2)}, placing all the variable terms on the left-hand side.
Furthermore, to complete x2+4xx^2+4x into a perfect square, we need to add 44 to it. But before we do that, we need to make sure that all the constant terms are on the other side of the equation. This is why we added 66 in row (3)\purpleC{(3)}, leaving x2+4xx^2+4x on its own.

Rule 2: Make sure the coefficient of x2x^2 is equal to 11.

This is how the solution of the equation 3x236x=423x^2-36x=-42 goes:
(1)3x236x=42(2)x212x=14Divide by 3.(3)x212x+36=22Add 36,completing the square.(4)(x6)2=22Factor.(5)(x6)2=±22Take the square root.(6)x6=±22(7)x=±22+6Add 6.\begin{aligned}(1)&&3x^2-36x&=-42\\\\ \maroonD{(2)}&&\maroonD{x^2-12x}&\maroonD{=-14}&&\maroonD{\text{Divide by 3.}}\\\\ (3)&&x^2-12x+36&=22&&\text{Add 36,completing the square.}\\\\ (4)&&(x-6)^2&=22&&\text{Factor.}\\\\ (5)&&\sqrt{(x-6)^2}&=\pm\sqrt{22}&&\text{Take the square root.}\\\\ (6)&&x-6&=\pm\sqrt{22}\\\\ (7)&&x&=\pm\sqrt{22}+6&&\text{Add 6.}\end{aligned}
The completing the square method only works if the coefficient of x2x^2 is 11.
In the completing the square method, we compare the given expression to the general perfect square (x+a)2(x+a)^2, which is expanded as x2+2ax+a2x^2+2ax+a^2. As you see, in this expression, the coefficient of x2x^2 is 11.
If we look at an expression like 3x236x3x^2-36x as the beginning of a perfect square, it will not be equal to the general perfect square (x+a)2(x+a)^2. Instead, it will be equal to the general perfect square (3x+a)2(\sqrt3\cdot x+a)^2, which is expanded as 3x2+2a3x+a23x^2+2a\sqrt3\cdot x+a^2. Good luck with that!
This is why in row (2)\maroonD{(2)} we divided by the coefficient of x2x^2, which is 33.
Sometimes, dividing by the coefficient of x2x^2 will result in other coefficients becoming fractions. This doesn't mean you did something wrong, it just means you will have to work with fractions in order to solve.
4x24x=11x2x=114Divide by 4.x2x+14=114+14Add 14, completing the square.(x12)2=3Factor.(x12)2=±3Take the square root.x12=±3x=±3+12Add 12.\begin{aligned}4x^2-4x&=11\\\\ x^2-x&=\dfrac{11}{4}&&\text{Divide by 4.}\\\\\\ x^2-x+\dfrac{1}{4}&=\dfrac{11}{4}+\dfrac{1}{4}&&\text{Add }\dfrac{1}{4}\text{, completing the square.}\\\\\\ \left(x-\dfrac{1}{2}\right)^2&=3&&\text{Factor.}\\\\\\ \sqrt{\left(x-\dfrac{1}{2}\right)^2}&=\pm\sqrt{3}&&\text{Take the square root.}\\\\\\ x-\dfrac{1}{2}&=\pm\sqrt{3}\\\\ x&=\pm\sqrt{3}+\dfrac{1}{2}&&\text{Add }\dfrac{1}{2}\text{.}\end{aligned}
In conclusion, the solutions are x=3+12x=\sqrt{3}+\dfrac{1}{2} and 3+12-\sqrt{3}+\dfrac{1}{2}.
Now it's your turn to solve an equation like this.
Solve 4x2+20x3=04x^2+20x-3=0.
Choose 1 answer:
Choose 1 answer:

4x2+20x3=04x2+20x=3Add 3x2+5x=34Divide by 4.x2+5x+254=7Add 254, completing the square.(x+52)2=7Factor.(x+52)2=±7Take the square root.x+52=±7x=±752Subtract 52.\begin{aligned}4x^2+20x-3&=0\\\\ 4x^2+20x&=3&&\text{Add 3}\\\\ x^2+5x&=\dfrac{3}{4}&&\text{Divide by 4.}\\\\\\ x^2+5x+\dfrac{25}{4}&=7&&\text{Add }\dfrac{25}{4}\text{, completing the square.}\\\\\\ \left(x+\dfrac{5}{2}\right)^2&=7&&\text{Factor.}\\\\\\ \sqrt{\left(x+\dfrac{5}{2}\right)^2}&=\pm\sqrt{7}&&\text{Take the square root.}\\\\\\ x+\dfrac{5}{2}&=\pm\sqrt{7}\\\\ x&=\pm\sqrt{7}-\dfrac{5}{2}&&\text{Subtract }\dfrac{5}{2}\text{.}\end{aligned}
In conclusion, the solutions are x=752x=\sqrt{7}-\dfrac{5}{2} and 752-\sqrt{7}-\dfrac{5}{2}.
Loading