Learn · Algebra and geometry (grades 8–10)

How to Solve by Completing the Square

Completing the square turns x² + bx into a perfect square like (x − 3)². Then you can solve by taking square roots. It also shows the vertex of a parabola.

Try it with your own problem ↓

The steps

  1. Make sure the x² coefficient is 1 (divide everything by it if not).
  2. Move the constant to the right side.
  3. Take half of the x coefficient, square it, and add it to both sides.
  4. Factor the left side as a perfect square: (x + half)².
  5. Take the square root of both sides (± on the right), then solve for x.

A worked example

Solve x² − 6x + 2 = 0.

  1. Move the constant: x² − 6x = −2.
  2. Half of −6 is −3, and (−3)² = 9. Add 9 to both sides: x² − 6x + 9 = −2 + 9 = 7.
  3. The left side factors: (x − 3)² = 7.
  4. Take the square root of both sides: x − 3 = ±√7.
  5. Add 3: x = 3 ± √7.

x = 3 ± √7, which is about 5.646 and 0.354.

Try it with your own problem

Open the free The Area Box with this example already filled in. It shows every step, and you can type over it with your own numbers.

Work it out: solve x^2-6x+2=0 by completing the squareOpens The Area Box with this example

Or try these

Common mistakes

Questions people ask

Why does it work?

(x − 3)² expands to x² − 6x + 9. Adding 9 gives the missing piece that makes a perfect square.

What if the x² coefficient isn't 1?

Divide the whole equation by it first. For 2x² − 8x + 3, factor 2 out of the x terms.

How does it help find a vertex?

y = a(x − h)² + k has its vertex at (h, k). For y = 2x² − 8x + 3 this gives 2(x − 2)² − 5, so the vertex is (2, −5).

Keep learning

Show The Steps is free, with no accounts or ads, and everything is worked out in your own browser. Start at the home page.