Math Playground
Algebra

Completing the square

Rewrite ax² + bx + c into a(x − h)² + k — and solve any quadratic.

Rewrite ax² + bx + c as a(x − h)² + k. The vertex is at (h, k) — and you can solve any quadratic.

Walk through
Step 1 of 5
The expression

Rewrite x² + 6x + 5 in the form (x + h)² + k.

The recipe

  • If a ≠ 1, factor a out of the x² and x terms first.
  • Take half the x-coefficient, square it — add and subtract that inside.
  • Fold the perfect square into a bracket; collect the leftover constant.
  • Result a(x − h)² + k tells you the vertex (h, k) directly.
Your turn

Complete the square for x² − 8x + 3.

Completing the square on the general ax² + bx + c is exactly how the quadratic formula is derived.

Try it

x² + 6x + 5

Half of 6 is 3. (x+3)² = x² + 6x + 9. So x² + 6x + 5 = (x+3)² − 4.