Square roots solve (x+3)2=16 in two lines. But most quadratics, like x2+6x−7=0, don't arrive as a perfect square. Completing the square is a way to rewrite any quadratic so that it does, which means you can then solve it with square roots, even when it won't factor. The same move also converts standard form into vertex form.
Perfect square trinomials
In the special products lesson you saw that squaring a binomial follows a pattern:
(x+p)2=x2+2px+p2.
Look at the relationship between the middle coefficient 2p and the constant p2: the constant is half the middle coefficient, squared.
trinomial
half of b
(2b)2
as a square
x2+6x+9
3
9
(x+3)2
x2−10x+25
−5
25
(x−5)2
x2+3x+49
23
49
(x+23)2
A picture explains the name. Think of x2+6x as an x-by-x square plus a strip of area 6x. Cut the strip in half and attach one 3-by-x piece to the right side and one to the bottom. The shape is almost a big square with side x+3, but a 3-by-3 corner is missing. Adding that corner, 9, completes the square.
Completing the square
To make x2+bx into a perfect square, add (2b)2:
x2+bx+(2b)2=(x+2b)2.
This works when the coefficient of x2 is 1.
Worked example: Finding the missing constant
What number completes the square? Write the result as a binomial squared.
x2−14x
x2+5x
Solutions.
Half of −14 is −7, and (−7)2=49. So x2−14x+49=(x−7)2.
Half of 5 is 25, and (25)2=425. So x2+5x+425=(x+25)2.
Solving by completing the square
Move the constant term to the right side.
If the coefficient of x2 isn't 1, divide every term by it.
Add (2b)2 to both sides.
Write the left side as a binomial squared.
Take square roots (with ±) and solve.
Worked example: A first example
Solve x2+6x−7=0 by completing the square.
x2+6xx2+6x+9(x+3)2x+3x=1=7=7+9=16=±4orx=−7move the constantadd (26)2=9 to both sides
This one also factors as (x+7)(x−1)=0, which confirms the answers.
Common mistake
Whatever you add to the left side, you must add to the right side too. Writing x2+6x+9=7 changes the equation and gives wrong answers. Think of it as a balance: +9 on one side needs +9 on the other.
Worked example: An irrational answer
Solve x2−4x−3=0.
This doesn't factor over the integers, but completing the square still works:
To tidy the radical, 213=213=226, so x=−2±226, about 0.55 and −4.55.
Vertex form by completing the square
Completing the square on an expression instead of an equation turns standard form into vertex form. Since there's no other side to balance, you add (2b)2 and immediately subtract it, which adds zero overall.
Rewrite y=x2+8x+10:
y=(x2+8x+16)−16+10=(x+4)2−6add and subtract (28)2=16
The vertex is (−4,−6). Setting y=0 gives (x+4)2=6, so the x-intercepts are −4±6, about −1.55 and −6.45.
y = x² + 8x + 10 = (x + 4)² - 6 has vertex (-4, -6) and x-intercepts -4 ± √6.Open in grapher →
When a=1, factor a out of the x-terms first. For y=2x2−12x+13:
y=2(x2−6x)+13=2(x2−6x+9)−18+13=2(x−3)2−5the added 9 is really 2⋅9=18
The vertex is (3,−5), which you can confirm with x=−2ab=412=3.
Tip
When a=1, the number you add inside the parentheses gets multiplied by a. Subtract a⋅(2b)2 outside, not just (2b)2. Expanding your final answer is a quick check.
Practice
Practice 1
What number must be added to x2+18x to make a perfect square trinomial?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 2
Find c so that x2−3x+c is a perfect square trinomial.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 3
Solve x2+10x+16=0 by completing the square.
Separate answers with commas, e.g. 2, -5
Practice 4
Solve x2−8x+3=0 by completing the square. What is the larger solution? Give an exact answer, such as 2 + sqrt(5).
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 5
Solve x2+2x−5=0.
Practice 6
Complete the square to write y=x2−10x+21 in vertex form. What is the vertex?
Enter a point like (2, -3)
Practice 7
Complete the square to write y=3x2+6x−2 in the form y=a(x−h)2+k. What is k?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Practice 8
Solve 2x2−12x+7=0 by completing the square. What is the larger solution? Give an exact answer.
Enter a number. Fractions like 3/4 and sqrt(2) are OK.