Part 35 of 36 · QuadraticsSee the whole course

Completing the square, step by step

Short answer

Completing the square rewrites x² + bx + c as (x + b/2)² + (c − b²/4). You add the square of half of b to make a perfect square, and take the same amount away so the value does not change. The result is vertex form, so you can read the vertex, and you can solve the equation by taking a square root.

The picture: a square with a corner missing

Look at x² + 6x. Draw a square with side x, which has area x². Then add two strips, each 3 wide and x long, which have area 3x each, 6x in all. You almost have a bigger square, but there is a corner missing: a 3 by 3 square, with area 9.

x²3x3x9 x3x3
x² + 6x + 9 is the whole square, with side x + 3. So x² + 6x + 9 = (x + 3)².

So add 9 to complete the square. But you cannot just add 9 and walk away: that changes the number. Add 9 and take 9 away, and the value stays the same.

The steps (when the number in front of x² is 1)

  1. Halve b, the number in front of x. For x² + 6x + 5, half of 6 is 3.
  2. Square it. 3² = 9.
  3. Add and subtract it: x² + 6x + 9 − 9 + 5.
  4. Write the first three terms as a square: (x + 3)² − 9 + 5.
  5. Tidy up the numbers: (x + 3)² − 4.

Try it. Move b and c. The vertex is always at x = −b/2, and the number that is left over, c − b²/4, is its height.

y = x² + 6x + 5
  1. half of 6 is 3, and 3² = 9
  2. y = (x² + 6x + 9) − 9 + 5
  3. y = (x + 3)² − 4
The vertex is (−3, −4). The bowl crosses the x-axis at x = −5 and x = −1.

Example 1: find the vertex of y = x² + 6x + 5

Half of 6 is 3, and 3² = 9
y = (x² + 6x + 9) − 9 + 5
y = (x + 3)² − 4
This is vertex form, y = (x − h)² + k, with h = −3 and k = −4. The vertex is (−3, −4).

Example 2: solve x² + 6x + 5 = 0

Use the same completed square, then undo it with a square root.

(x + 3)² − 4 = 0
(x + 3)² = 4
x + 3 = 2 or x + 3 = −2 (both signs: 2² and (−2)² are 4)
x = −1 or x = −5
Check: (−1)² + 6(−1) + 5 = 1 − 6 + 5 = 0 ✓ and (−5)² + 6(−5) + 5 = 25 − 30 + 5 = 0 ✓

This one also factors, as (x + 1)(x + 5), which is the same answer by factoring. The point of completing the square is that it works even when factoring does not.

Example 3: it does not factor, x² − 8x + 3 = 0

Half of −8 is −4, and (−4)² = 16
Move the 3 across: x² − 8x = −3
Add 16 to both sides: x² − 8x + 16 = 13
(x − 4)² = 13
x − 4 = √13 or x − 4 = −√13
x = 4 + √13 or x = 4 − √13, about 7.61 or 0.39
Check x = 4 + √13: x² = 29 + 8√13, and −8x = −32 − 8√13, so 29 − 32 + 3 = 0 ✓

Notice the sign: half of −8 is −4, so the square is (x − 4)². The sign inside the bracket is the sign of half of b.

Example 4: when the number in front of x² is not 1, y = 2x² + 12x + 5

First take the 2 out of the x-terms. Then complete the square inside the bracket.

y = 2(x² + 6x) + 5
Inside the bracket, add and subtract 9: y = 2(x² + 6x + 9 − 9) + 5
Take the −9 out of the bracket. It is multiplied by 2, so it becomes −18: y = 2(x + 3)² − 18 + 5
y = 2(x + 3)² − 13
The vertex is (−3, −13).

That −9 is the trap. It sits inside a bracket that is multiplied by 2, so what comes out is 2 × (−9) = −18.

Where the quadratic formula comes from

Complete the square on the general equation ax² + bx + c = 0 and you get x = (−b ± √(b² − 4ac)) ÷ 2a. The quadratic formula is just this method done once, for every quadratic at the same time. See the quadratic formula and the discriminant.

Watch it explained in under a minute

The same idea, narrated step by step. Square version for sharing: download the 1:1 video.
Read the video transcript

Here is a quadratic: x² + 6x + 5. We want a form that shows the vertex. The trick: completing the square.

Take half of the 6, which is 3. Square it: 9. Now add 9, and take 9 away.

The first three terms are now a perfect square. (x + 3)². And −9 + 5 is −4.

This is vertex form. The vertex is at (−3, −4). The graph agrees.

To solve, set it equal to 0. (x + 3)² = 4. So x + 3 is 2, or −2. x = −1, or x = −5.

Want practice questions and more examples? Full guide: pipmath.app/blog

The five mistakes to avoid

Try it yourself

Tap a question to see the answer.

1. Complete the square: x² + 10x + 7

Half of 10 is 5, and 5² = 25. x² + 10x + 25 − 25 + 7 = (x + 5)² − 18. The vertex is (−5, −18).

2. Solve x² − 4x − 5 = 0 by completing the square

Half of −4 is −2, and (−2)² = 4. Add 5 to both sides: x² − 4x = 5. Add 4: (x − 2)² = 9. So x − 2 = 3 or x − 2 = −3, which gives x = 5 or x = −1. Check: 25 − 20 − 5 = 0 ✓.

3. Find the vertex of y = x² − 6x + 4

Half of −6 is −3, and (−3)² = 9. y = (x² − 6x + 9) − 9 + 4 = (x − 3)² − 5. The vertex is (3, −5).

Where this fits in

You now have three ways to solve a quadratic: factoring when the numbers are friendly, completing the square when you want the vertex or a clean method, and one formula that solves them all. That formula is next: the quadratic formula and the discriminant.

Quick answers

Questions about this topic

What is completing the square?

Completing the square rewrites a quadratic like x² + bx + c as (x + b/2)² plus a number. You add the square of half of b to make a perfect square, and subtract the same amount so the value does not change.

How do you complete the square?

Halve the number in front of x, square it, add and subtract it, then write the first three terms as a bracket squared. For x² + 6x + 5, half of 6 is 3, so you get (x + 3)² − 4.

Why is it called completing the square?

Because x² + bx is a square with a corner missing. Adding the square of half of b fills in the missing corner and makes a complete square with side x + b/2.

When should I use completing the square?

Use it to find the vertex of a parabola, to solve a quadratic that does not factor, or to see where the quadratic formula comes from. If the numbers factor nicely, factoring is faster.

Keep going

Learn it by playing

Pip: Math Adventure is a math game for iPhone where functions, lines, equations and calculus are puzzles you solve by playing. It is coming soon to the App Store.

Join the list and we will tell you the day Pip is out.