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 x, start superscript, 2, end superscript, plus, 6, x, equals, minus, 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 x raised to the first power.
Furthermore, you simply can't factor x, start superscript, 2, end superscript, plus, 6, x, plus, 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, equals, square root of, 7, end square root, minus, 3 and x, equals, minus, square root of, 7, end square root, minus, 3.

What happened here?

Adding 9 to x, start superscript, 2, end superscript, plus, 6, x in row start color blueD, left parenthesis, 2, right parenthesis, end color blueD had the fortunate result of making the expression a perfect square that can be factored as left parenthesis, x, plus, 3, right parenthesis, start superscript, 2, end superscript. This allowed us to solve the equation by taking the square root.
This was no coincidence, of course. The number 9 was carefully chosen so the resulting expression would be a perfect square.

How to complete the square

To understand how 9 was chosen, we should ask ourselves the following question: If x, start superscript, 2, end superscript, plus, 6, x 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 left parenthesis, x, plus, a, right parenthesis, start superscript, 2, end superscript where the value of constant a is still unknown. This expression is expanded as x, start superscript, 2, end superscript, plus, 2, a, x, plus, a, start superscript, 2, end superscript, which tells us two things:
  1. The coefficient of x, which we know to be 6, should be equal to 2, a. This means that a, equals, 3.
  2. The constant number we need to add is equal to a, start superscript, 2, end superscript, which is 3, start superscript, 2, end superscript, equals, 9.
Try to complete a few squares on your own.
What is the missing constant term in the perfect square that starts with x, start superscript, 2, end superscript, plus, 10, x ?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, p, i or 2, slash, 3, space, p, i

We want to add a constant number to x, start superscript, 2, end superscript, plus, start color tealD, 10, end color tealD, x so it is in the form x, start superscript, 2, end superscript, plus, start color tealD, 2, a, end color tealD, x, plus, a, start superscript, 2, end superscript. In that form, the coefficient of x is start color tealD, 2, a, end color tealD, and in our expression that coefficient is start color tealD, 10, end color tealD. Therefore, start color tealD, 2, a, end color tealD, equals, start color tealD, 10, end color tealD, which means a, equals, 5.
The constant number we need to add to get to that form is a, start superscript, 2, end superscript, which is 5, start superscript, 2, end superscript, equals, 25. This way, the expression will be x, start superscript, 2, end superscript, plus, 10, x, plus, 25 which is factored as left parenthesis, x, plus, 5, right parenthesis, start superscript, 2, end superscript.
In conclusion, the constant we should add is 25.
What is the missing constant term in the perfect square that starts with x, start superscript, 2, end superscript, minus, 2, x ?
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, p, i or 2, slash, 3, space, p, i

We want to add a constant number to x, start superscript, 2, end superscript, start color tealD, minus, 2, end color tealD, x so it is in the form x, start superscript, 2, end superscript, plus, start color tealD, 2, a, end color tealD, x, plus, a, start superscript, 2, end superscript. In that form, the coefficient of x is start color tealD, 2, a, end color tealD, and in our expression that coefficient is start color tealD, minus, 2, end color tealD. Therefore, start color tealD, 2, a, end color tealD, equals, start color tealD, minus, 2, end color tealD which means a, equals, minus, 1.
The constant number we need to add to get to that form is a, start superscript, 2, end superscript, which is left parenthesis, minus, 1, right parenthesis, start superscript, 2, end superscript, equals, 1. This way, the expression will be x, start superscript, 2, end superscript, minus, 2, x, plus, 1, which is factored as left parenthesis, x, minus, 1, right parenthesis, start superscript, 2, end superscript.
In conclusion, the constant we should add is 1.
What is the missing constant term in the perfect square that starts with x, start superscript, 2, end superscript, plus, start fraction, 1, divided by, 2, end fraction, x ?
  • Your answer should be
  • a simplified proper fraction, like 3, slash, 5

We want to add a constant number to x, start superscript, 2, end superscript, plus, start color tealD, start fraction, 1, divided by, 2, end fraction, end color tealD, x so it is in the form x, start superscript, 2, end superscript, plus, start color tealD, 2, a, end color tealD, x, plus, a, start superscript, 2, end superscript. In that form, the coefficient of x is start color tealD, 2, a, end color tealD, and in our expression that coefficient is start color tealD, start fraction, 1, divided by, 2, end fraction, end color tealD. Therefore, start color tealD, 2, a, end color tealD, equals, start color tealD, start fraction, 1, divided by, 2, end fraction, end color tealD, which means a, equals, start fraction, 1, divided by, 4, end fraction.
The constant number we need to add to get to that form is a, start superscript, 2, end superscript, which is left parenthesis, start fraction, 1, divided by, 4, end fraction, right parenthesis, start superscript, 2, end superscript, equals, start fraction, 1, divided by, 16, end fraction. This way, the expression will be x, start superscript, 2, end superscript, plus, start fraction, 1, divided by, 2, end fraction, x, plus, start fraction, 1, divided by, 16, end fraction, which is factored as left parenthesis, x, plus, start fraction, 1, divided by, 4, end fraction, right parenthesis, start superscript, 2, end superscript.
In conclusion, the constant we should add is start fraction, 1, divided by, 16, end fraction.

Challenge question

What is the missing constant term in the perfect square that starts with x, start superscript, 2, end superscript, plus, b, space, dot, space, space, x?
Please choose from one of the following options.

We want to add a constant number to x, start superscript, 2, end superscript, plus, start color tealD, b, end color tealD, dot, x so it is in the form x, start superscript, 2, end superscript, plus, start color tealD, 2, a, end color tealD, x, plus, a, start superscript, 2, end superscript. In that form, the coefficient of x is start color tealD, 2, a, end color tealD, and in our expression that coefficient is start color tealD, b, end color tealD. Therefore, start color tealD, 2, a, end color tealD, equals, start color tealD, b, end color tealD, which means a, equals, start fraction, b, divided by, 2, end fraction.
The constant number we need to add to get to that form is a, start superscript, 2, end superscript, which is left parenthesis, start fraction, b, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript. This way, the expression will be x, start superscript, 2, end superscript, plus, 2, dot, start fraction, b, divided by, 2, end fraction, dot, x, plus, left parenthesis, start fraction, b, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript, which is factored as left parenthesis, x, plus, start fraction, b, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript.
In conclusion, the constant we should add is left parenthesis, start fraction, b, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript.
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 x, start superscript, 2, end superscript, plus, b, x into a perfect square, where b is any number, we need to add left parenthesis, start fraction, b, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript to it.
For example, in order to complete x, start superscript, 2, end superscript, plus, start color blueD, 6, end color blueD, x into a perfect square, we added left parenthesis, start fraction, start color blueD, 6, end color blueD, divided by, 2, end fraction, right parenthesis, start superscript, 2, end superscript, equals, 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 x, start superscript, 2, end superscript, minus, 10, x, equals, minus, 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 x, start superscript, 2, end superscript, minus, 10, x a perfect square, we added 25 in row start color blueD, left parenthesis, 2, right parenthesis, end color blueD. As always with equations, we did the same for the right-hand side, which made it increase from minus, 12 to 13.
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 x, start superscript, 2, end superscript, minus, 8, x, equals, 5.
Please choose from one of the following options.

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, equals, square root of, 21, end square root, plus, 4 and minus, square root of, 21, end square root, plus, 4.
Solve x, start superscript, 2, end superscript, plus, 3, x, equals, minus, start fraction, 1, divided by, 4, end fraction.
Please choose from one of the following options.

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, equals, square root of, 2, end square root, minus, start fraction, 3, divided by, 2, end fraction and minus, square root of, 2, end square root, minus, start fraction, 3, divided by, 2, end fraction.

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 x, start superscript, 2, end superscript, plus, 5, x, minus, 6, equals, x, plus, 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 x-term on the other side. This is why we subtracted x in row start color tealD, left parenthesis, 2, right parenthesis, end color tealD, placing all the variable terms on the left-hand side.
Furthermore, to complete x, start superscript, 2, end superscript, plus, 4, x into a perfect square, we need to add 4 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 6 in row start color purpleC, left parenthesis, 3, right parenthesis, end color purpleC, leaving x, start superscript, 2, end superscript, plus, 4, x on its own.

Rule 2: Make sure the coefficient of x, start superscript, 2, end superscript is equal to 1.

This is how the solution of the equation 3, x, start superscript, 2, end superscript, minus, 36, x, equals, minus, 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 x, start superscript, 2, end superscript is 1.
In the completing the square method, we compare the given expression to the general perfect square left parenthesis, x, plus, a, right parenthesis, start superscript, 2, end superscript, which is expanded as x, start superscript, 2, end superscript, plus, 2, a, x, plus, a, start superscript, 2, end superscript. As you see, in this expression, the coefficient of x, start superscript, 2, end superscript is 1.
If we look at an expression like 3, x, start superscript, 2, end superscript, minus, 36, x as the beginning of a perfect square, it will not be equal to the general perfect square left parenthesis, x, plus, a, right parenthesis, start superscript, 2, end superscript. Instead, it will be equal to the general perfect square left parenthesis, square root of, 3, end square root, dot, x, plus, a, right parenthesis, start superscript, 2, end superscript, which is expanded as 3, x, start superscript, 2, end superscript, plus, 2, a, square root of, 3, end square root, dot, x, plus, a, start superscript, 2, end superscript. Good luck with that!
This is why in row start color maroonD, left parenthesis, 2, right parenthesis, end color maroonD we divided by the coefficient of x, start superscript, 2, end superscript, which is 3.
Sometimes, dividing by the coefficient of x, start superscript, 2, end superscript 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, equals, square root of, 3, end square root, plus, start fraction, 1, divided by, 2, end fraction and minus, square root of, 3, end square root, plus, start fraction, 1, divided by, 2, end fraction.
Now it's your turn to solve an equation like this.
Solve 4, x, start superscript, 2, end superscript, plus, 20, x, minus, 3, equals, 0.
Please choose from one of the following options.

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, equals, square root of, 7, end square root, minus, start fraction, 5, divided by, 2, end fraction and minus, square root of, 7, end square root, minus, start fraction, 5, divided by, 2, end fraction.