Skip to content
ihateDesmos

Completing the square

7 min read · Updated 6 November 2026

Completing the square rewrites a quadratic so that it contains a perfect square, like (x + 3)². That makes it easy to solve the equation, find the vertex of the parabola, and see where the quadratic formula comes from.

How to complete the square

Take half the coefficient of x, square it, then add it and subtract it. For x² + 6x + 5:

  1. Halve the x coefficient: half of 6 is 3.
  2. Square it: 3² = 9.
  3. Add and subtract 9: x² + 6x + 9 − 9 + 5.
  4. Write the perfect square: x² + 6x + 9 = (x + 3)².
  5. Tidy up the rest: (x + 3)² − 4.

Since we added and subtracted the same number, the value hasn’t changed. Only its form has.

Why it’s called “completing the square”

Picture x² + 6x as a shape: an x-by-x square, and a 6-by-x rectangle. Cut the rectangle in half and put a piece on two sides of the square. You now have a larger square with a corner missing, and that missing corner measures 3 × 3 = 9. Adding 9 literally completes the square, giving a side of x + 3.

Solving a quadratic equation

Solve x² + 6x + 5 = 0:

  1. Complete the square: (x + 3)² − 4 = 0.
  2. Move the constant: (x + 3)² = 4.
  3. Take square roots, keeping both signs: x + 3 = ±2.
  4. Solve each: x = −1 or x = −5.
−6−4−2−4−2240
Open in calculator
The parabola
y=(x+3)2−4
, with its vertex at (−3, −4) and x-intercepts at −5 and −1.

When a isn’t 1

Factor a out of the x terms first. For 2x² + 8x + 3:

  1. Factor 2 from the first two terms: 2(x² + 4x) + 3.
  2. Inside the bracket, half of 4 is 2, and 2² = 4.
  3. Add and subtract 4 inside: 2(x² + 4x + 4 − 4) + 3.
  4. Write the perfect square: 2((x + 2)² − 4) + 3.
  5. Multiply out and combine: 2(x + 2)² − 8 + 3 = 2(x + 2)² − 5.

The most common mistake is forgetting that the 2 outside multiplies the −4 inside, giving −8. The completing the square calculator shows these steps for any values.

When b is odd

Fractions appear, but the method is the same. For x² + 5x + 1:

  1. Half of 5 is 5/2, and (5/2)² = 25/4.
  2. Add and subtract: (x + 5/2)² − 25/4 + 1.
  3. Combine: (x + 5/2)² − 21/4.

Finding the vertex

The completed form is exactly vertex form, y = a(x − h)² + k, with the vertex at (h, k). So 2(x + 2)² − 5 has its vertex at (−2, −5), which is its lowest point. A square is never negative, so y is smallest when the bracket is zero. This is the quickest way to find a maximum or minimum without calculus.

When should you use it?

  • When you need vertex form, or the maximum or minimum of a quadratic.
  • When the x coefficient is even and a = 1, so there are no fractions.
  • For circles: x² + y² + 4x − 6y = 3 becomes (x + 2)² + (y − 3)² = 16 by completing the square twice, which gives the centre and radius.
  • In calculus, for integrals of fractions with a quadratic on the bottom.

Frequently asked questions

What does it mean to complete the square?
To rewrite a quadratic as a perfect square plus a constant, such as x² + 6x + 5 = (x + 3)² − 4.
What number do you add to complete the square?
The square of half the x coefficient. For x² + 10x, that is 5² = 25.
How do you complete the square when a isn’t 1?
Factor a out of the x² and x terms, complete the square inside the bracket, then multiply the leftover by a.
Why add and subtract the same number?
So the expression keeps its value. Adding zero, in the form +9 − 9, changes its look without changing what it equals.
Is completing the square better than the quadratic formula?
It depends on what you want. The formula is usually quicker for finding roots, while completing the square also gives the vertex.

Keep going

Try it in the calculator

Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.

Open the calculator