Completing the square turns x2+bx into a perfect square by adding (2b)2, half of b, squared. Then x2+bx+(2b)2=(x+2b)2. Use it to solve quadratics that do not factor, to rewrite y=ax2+bx+c in vertex form, and to find the center and radius of a circle from its expanded equation.
Updated
On this page
The key idea
A perfect square trinomial always has the same pattern: the last number is half the middle coefficient, squared. Completing the square means adding exactly that number so the pattern appears.
x2+bx+(2b)2=(x+2b)2
For example, half of 10 is 5 and 52=25, so x2+10x+25=(x+5)2.
The steps for solving
If the x2 coefficient is not 1, divide every term by it.
Move the constant to the right side.
Add (2b)2 to both sides.
Write the left side as a squared binomial.
Take the square root of both sides, with ±, and solve.
Worked examples
Example 1: solve by completing the square
Problem Solve x2+6x−7=0.
Move the constant to the right.
x2+6x=7
Half of 6 is 3, and 32=9. Add 9 to both sides.
x2+6x+9=16
The left side is now a perfect square.
(x+3)2=16
Square root of both sides. Remember both signs: x+3=4 or x+3=−4.
Subtract 3 in each case: x=1 or x=−7. Check: 1+6−7=0 and 49−42−7=0.
Answerx=1 or x=−7
Example 2: when the leading coefficient is not 1
Problem Solve 2x2−8x−5=0. Give exact answers.
Divide every term by 2.
x2−4x−25=0
Move the constant.
x2−4x=25
Half of −4 is −2, and (−2)2=4. Add 4 to both sides.
x2−4x+4=213
Factor the left side.
(x−2)2=213
Take square roots: x−2=±213. Since 213=226, add 2 to get the answer.
Answerx=2±226, which is about 4.55 or −0.55
Example 3: vertex form
Problem Write y=3x2+12x+5 in vertex form and give the vertex.
Factor the 3 out of the x terms only.
3x2+12x+5=3(x2+4x)+5
Inside the parentheses, half of 4 is 2, and 22=4. Add 4 and subtract 4 inside so nothing changes.
3(x2+4x)+5=3(x2+4x+4−4)+5
Move the −4 out. It gets multiplied by the 3 on its way out.
3(x2+4x+4−4)+5=3(x+2)2−12+5
Combine the constants.
3(x+2)2−12+5=3(x+2)2−7
Answery=3(x+2)2−7, so the vertex is (−2,−7)
Example 4 (test-hard): center and radius of a circle
Problem Find the center and radius of the circle x2+y2+10x−4y−7=0.
Group the x terms and the y terms, and move the constant.
x2+10x+y2−4y=7
Complete the square twice: add 52=25 for x and (−2)2=4 for y, on both sides.
(x2+10x+25)+(y2−4y+4)=7+25+4
Factor each group.
(x+5)2+(y−2)2=36
Compare with (x−h)2+(y−k)2=r2. Here h=−5, k=2, and r2=36.
Answer Center (−5,2), radius 6
Common mistakes
Adding the number to one side only. If you add 9 on the left, add 9 on the right too. Fix: write "+9" on both sides in the same step.
Completing the square before dividing by a. With 2x2−8x, half of −8 is not the right number. Fix: make the x2 coefficient 1 first, or factor it out of the x terms.
Forgetting the factor outside the parentheses. In 3(x2+4x+4−4), the −4 leaves as −12, not −4. Fix: multiply by the outside factor when you move a number out.
Taking only the positive square root.(x+3)2=16 has two answers. Fix: write ± as soon as you take the root.
Reading the circle radius as r2. In (x+5)2+(y−2)2=36, the radius is 6, not 36. Also, the center is (−5,2): the signs flip.
Quick methods
Practice
5 practice questions
What number should be added to x2−14x to make a perfect square trinomial?
7
14
49
196
Show answer
Answer: 49
Half of −14 is −7, and (−7)2=49. So x2−14x+49=(x−7)2. 7 is half of b but not squared, and 196 squares b without halving.
Which is x2+8x+10 written in vertex form?
(x+4)2−6
(x+4)2+10
(x−4)2−6
(x+8)2−54
Show answer
Answer: (x+4)2−6
x2+8x+16−16+10=(x+4)2−6. (x+4)2+10 forgets to subtract the 16 you added. (x−4)2 has the wrong sign inside.
Solve x2−2x−4=0 by completing the square.
1±5
−1±5
1±3
2±5
Show answer
Answer: 1±5
x2−2x=4. Add 1: (x−1)2=5, so x=1±5. 1±3 subtracts the 1 instead of adding it.
What is the vertex of y=−2x2+12x−11?
(3,7)
(−3,7)
(3,−11)
(6,−11)
Show answer
Answer: (3,7)
−2(x2−6x)−11=−2(x2−6x+9)+18−11=−2(x−3)2+7. The −9 leaves the parentheses as +18 because it is multiplied by −2.
What is the radius of the circle x2+y2−6x+8y=0?
Show answer
Answer: 5
Add 9 and 16 to both sides: (x−3)2+(y+4)2=25. So r2=25 and the radius is 5. The center is (3,−4).
Frequently asked questions
When should I complete the square instead of factoring?
Factor first if the numbers work out quickly. Complete the square when the quadratic does not factor nicely, when a problem asks for vertex form, or when you need a circle's center and radius. When the x coefficient is even, it is often faster than the quadratic formula.
Where does the quadratic formula come from?
It is completing the square done once on ax2+bx+c=0 with letters instead of numbers. Divide by a, move ac, add 4a2b2 to both sides, take square roots, and you get x=2a−b±b2−4ac.
Why do I add the number to both sides?
An equation stays true only if both sides change the same way. When solving, you add to both sides. When rewriting an expression like y=…, there is no other side, so you add and subtract the same number instead, which adds zero.
What if the right side becomes negative?
If you reach (x−h)2= a negative number, there are no real solutions, because no real square is negative. In Algebra 2 you can still solve it with i: (x−1)2=−9 gives x=1±3i.