Guides / Quadratics

Completing the square, step by step

Solve quadratics and find vertex form by building a perfect square. Every step shown, plus the line where it usually goes wrong.

Short answer

To complete the square on x2 + bx + c = 0: move c to the right side, add (b/2)2 to both sides, rewrite the left side as (x + b/2)2, then take the square root of both sides (with ±) and solve for x. If the x2 term has a number in front of it, divide every term by that number first.

Why it works

A perfect square trinomial always has the same shape: (x + k)2 = x2 + 2kx + k2. The middle coefficient is 2k, so if the middle coefficient of your quadratic is b, then k is half of b, and the constant that would make it a perfect square is k2, which is (b/2)2.

Completing the square just means adding that missing constant so the left side factors neatly. Because you're working with an equation, you add the same number to the other side too, which keeps both sides equal.

Example 1: x2 + 6x − 7 = 0

  1. x2 + 6x − 7 = 0Start.
  2. x2 + 6x = 7Add 7 to both sides so only the x terms are on the left.
  3. x2 + 6x + 9 = 7 + 9Half of 6 is 3, and 32 = 9. Add 9 to both sides.
  4. (x + 3)2 = 16The left side is now a perfect square.
  5. x + 3 = ±4Take the square root of both sides. Both 4 and −4 square to 16.
  6. x = −3 + 4 or x = −3 − 4Subtract 3 from both sides.
  7. x = 1 or x = −7

Check by substituting: 12 + 6(1) − 7 = 0 and (−7)2 + 6(−7) − 7 = 49 − 42 − 7 = 0. Both work.

Example 2: when the x² term has a coefficient

Solve 2x2 + 8x − 3 = 0. The “half of b, squared” rule only works when the x2 term is just x2, so divide first.

  1. 2x2 + 8x − 3 = 0Start.
  2. x2 + 4x − 32 = 0Divide every term by 2.
  3. x2 + 4x = 32Move the constant to the right.
  4. x2 + 4x + 4 = 32 + 4Half of 4 is 2, and 22 = 4. Add 4 to both sides.
  5. (x + 2)2 = 112Because 3/2 + 4 = 3/2 + 8/2 = 11/2.
  6. x + 2 = ±√112Square root of both sides, with ±.
  7. x = −2 ± √222Subtract 2. Simplify: √(11/2) = √11 / √2 = √22 / 2.

As decimals, x ≈ 0.35 or x ≈ −4.35. When the answer has a square root in it, completing the square (or the quadratic formula, which is completing the square done once in general) is the way to get it. Factoring won't find it.

Example 3: vertex form of y = x2 − 10x + 18

Here there's nothing to solve. You want to rewrite the expression as (x − h)2 + k so you can read off the vertex. Instead of adding to both sides, add and subtract the same number on one side, which is the same as adding zero.

  1. y = x2 − 10x + 18Start.
  2. y = (x2 − 10x + 25) − 25 + 18Half of −10 is −5, and (−5)2 = 25. Add 25 and take 25 away.
  3. y = (x − 5)2 − 7Factor the square and combine −25 + 18.

The vertex is (5, −7). Check by expanding: (x − 5)2 − 7 = x2 − 10x + 25 − 7 = x2 − 10x + 18.

Common mistakes, and the exact line they happen on

1. Adding the square to only one side

  1. x2 + 6x = 7Fine so far.
  2. x2 + 6x + 9 = 7This is the mistake. 9 was added to the left but not the right, so this is a different equation.
  3. (x + 3)2 = 7Correct factoring of a wrong line.
  4. x = −3 ± √7Correct algebra, wrong answer.

Everything after the second line is good algebra, and the answer is still wrong. That's what makes this mistake frustrating: if you only compare final answers, all you learn is “wrong.” The fix is one line back, where the 9 appeared on only one side.

2. Skipping the divide when the x² term has a coefficient

  1. 2x2 + 8x = 3Fine so far.
  2. 2x2 + 8x + 16 = 3 + 16This is the mistake. (8/2)2 = 16 only makes a perfect square when the x2 term is 1x2. 2x2 + 8x + 16 doesn't factor as a square.

Divide by 2 first, as in Example 2. Or factor the 2 out of the x terms, 2(x2 + 4x) = 3, then add 4 inside the parentheses and 8 to the right side, because the 4 you added is being multiplied by 2. Either way you get (x + 2)2 = 11/2.

3. Dropping the ±

  1. (x + 3)2 = 16Fine so far.
  2. x + 3 = 4Half an answer. −4 also squares to 16, so x = −7 has been lost.

Practice

Try each one on paper before opening the answer.

  1. Solve x2 + 8x + 12 = 0 by completing the square.

    Show answer

    x2 + 8x = −12, add 16: (x + 4)2 = 4, so x + 4 = ±2 and x = −2 or x = −6.

  2. Solve x2 − 4x − 1 = 0.

    Show answer

    x2 − 4x = 1, add 4: (x − 2)2 = 5, so x = 2 ± √5.

  3. Solve 3x2 − 12x + 9 = 0.

    Show answer

    Divide by 3: x2 − 4x + 3 = 0. Then x2 − 4x = −3, add 4: (x − 2)2 = 1, so x = 3 or x = 1.

  4. Write y = x2 + 2x + 5 in vertex form and give the vertex.

    Show answer

    y = (x2 + 2x + 1) − 1 + 5 = (x + 1)2 + 4. Vertex (−1, 4).

  5. Solve x2 + 5x − 6 = 0. (Half of an odd number is a fraction. That's fine.)

    Show answer

    Half of 5 is 5/2, and (5/2)2 = 25/4. So (x + 5/2)2 = 6 + 25/4 = 49/4, x + 5/2 = ±7/2, and x = 1 or x = −6.