High school

How to complete the square, step by step

· 3 min read

Quick answerMove the constant to the right, add (b/2)² to both sides, write the left side as a squared bracket, take the square root of both sides, and solve. For x² + 6x + 5 = 0: x² + 6x = −5, add 9 to get (x + 3)² = 4, so x + 3 = ±2 and x = −1 or x = −5.

Completing the square turns a quadratic into something of the form (x+number)2=number(x + \text{number})^2 = \text{number}, which you can solve with a square root. It works on every quadratic, including the ones that will not factor.

The five steps

For an equation x2+bx+c=0x^2 + bx + c = 0:

  1. Move the constant to the right side.
  2. Halve the middle number and square it. Add that to both sides.
  3. Write the left side as a square: (x+b2)2(x + \tfrac{b}{2})^2.
  4. Take the square root of both sides. Remember the ±.
  5. Solve for xx.

Example 1

Solve x2+6x+5=0x^2 + 6x + 5 = 0.

Move the 5:

x2+6x=−5x^2 + 6x = -5

Half of 6 is 3, and 32=93^2 = 9. Add 9 to both sides:

x2+6x+9=4x^2 + 6x + 9 = 4

The left side is now a perfect square:

(x+3)2=4(x + 3)^2 = 4

Take the square root of both sides:

x+3=±2x + 3 = \pm 2

So x=−3+2=−1x = -3 + 2 = -1 or x=−3−2=−5x = -3 - 2 = -5.

Example 2: an answer with a square root

Solve x2−4x−1=0x^2 - 4x - 1 = 0. This one does not factor.

x2−4x=1x^2 - 4x = 1

Half of −4 is −2, and (−2)2=4(-2)^2 = 4. Add 4 to both sides:

x2−4x+4=5x^2 - 4x + 4 = 5 (x−2)2=5(x - 2)^2 = 5 x−2=±5x - 2 = \pm\sqrt{5} x=2±5x = 2 \pm \sqrt{5}

As decimals, x≈4.236x \approx 4.236 or x≈−0.236x \approx -0.236.

Example 3: the first number is not 1

Solve 2x2+8x−10=02x^2 + 8x - 10 = 0.

The method needs a plain x2x^2, so divide everything by 2 first:

x2+4x−5=0x^2 + 4x - 5 = 0 x2+4x=5x^2 + 4x = 5

Half of 4 is 2, and 22=42^2 = 4:

x2+4x+4=9x^2 + 4x + 4 = 9 (x+2)2=9(x + 2)^2 = 9 x+2=±3x + 2 = \pm 3

So x=1x = 1 or x=−5x = -5.

Why adding (b/2)² works

Expand a squared bracket: (x+3)2=x2+6x+9(x + 3)^2 = x^2 + 6x + 9. The middle number, 6, is twice the 3, and the last number, 9, is the 3 squared. So if you have x2+6xx^2 + 6x and want a perfect square, the missing piece is always (half the middle number) squared.

Common mistakes

  • Adding to one side only. The 9 in Example 1 goes on both sides.
  • Forgetting the ±. A square root gives two values, and that is where the second solution comes from.
  • Not dividing first when the number in front of x2x^2 is not 1.
  • Sign of the bracket. x2−4x+4x^2 - 4x + 4 is (x−2)2(x - 2)^2, with the same sign as the middle term.

You can check any answer with our quadratic equation solver. If the numbers are simple, factoring is usually quicker.

Practice problems

1. x2+2x−8=0x^2 + 2x - 8 = 0

Answer

x2+2x+1=9x^2 + 2x + 1 = 9, so (x+1)2=9(x + 1)^2 = 9 and x+1=±3x + 1 = \pm 3. x=2x = 2 or x=−4x = -4.

2. x2−10x+21=0x^2 - 10x + 21 = 0

Answer

x2−10x+25=4x^2 - 10x + 25 = 4, so (x−5)2=4(x - 5)^2 = 4 and x−5=±2x - 5 = \pm 2. x=7x = 7 or x=3x = 3.

3. x2+8x+3=0x^2 + 8x + 3 = 0

Answer

x2+8x+16=13x^2 + 8x + 16 = 13, so (x+4)2=13(x + 4)^2 = 13 and x=−4±13x = -4 \pm \sqrt{13}.

4. 3x2−12x+6=03x^2 - 12x + 6 = 0

Answer

Divide by 3: x2−4x+2=0x^2 - 4x + 2 = 0. Then x2−4x+4=2x^2 - 4x + 4 = 2, so (x−2)2=2(x - 2)^2 = 2 and x=2±2x = 2 \pm \sqrt{2}.

More on algebra