Completing the Square Calculator

Solve ax² + bx + c = 0 by completing the square. See the vertex form a(x − h)² + k, the 9-step method, and the exact roots with decimals.

Loading calculator…

What completing the square means

To complete the square is to rewrite a quadratic ax2+bx+cax^2 + bx + c so its variable terms form a single squared binomial: a(xh)2+ka(x - h)^2 + k. This is called vertex form, because (h,k)(h, k) is the vertex of the parabola y=ax2+bx+cy = ax^2 + bx + c. Once the equation is in this shape, solving a(xh)2+k=0a(x-h)^2 + k = 0 for xx is just arithmetic — no factoring required.

Tip: Use completing the square when a quadratic does not factor nicely. It always works, and it is also how the quadratic formula itself is derived.

The 9-step method

  1. Write the equation as ax2+bx+c=0ax^2 + bx + c = 0.
  2. If a1a \neq 1, divide every term by aa.
  3. Move the constant term to the right side.
  4. Take half of the xx-coefficient and square it: (b/2)2(b/2)^2.
  5. Add that value to both sides.
  6. Write the left side as a perfect square, (x+b/2)2(x + b/2)^2.
  7. Take the square root of both sides — remember ±\pm.
  8. Move the remaining constant to isolate xx.
  9. Simplify: the ±\pm gives the two roots.

Worked example — a ≠ 1

Solve 2x212x+7=02x^2 - 12x + 7 = 0.

  1. Divide by a=2a = 2: x26x+3.5=0x^2 - 6x + 3.5 = 0.
  2. Move the constant: x26x=3.5x^2 - 6x = -3.5.
  3. Half the xx-coefficient, squared: (6/2)2=9(-6/2)^2 = 9.
  4. Add 9 to both sides: x26x+9=3.5+9=5.5x^2 - 6x + 9 = -3.5 + 9 = 5.5.
  5. Perfect square: (x3)2=5.5(x - 3)^2 = 5.5.
  6. Square root both sides: x3=±5.5x - 3 = \pm\sqrt{5.5}.
  7. Isolate xx: x=3±5.55.3452x = 3 \pm \sqrt{5.5} \approx 5.3452 or 0.65480.6548.

The vertex form is 2(x3)2112(x - 3)^2 - 11, so the vertex of this parabola is (3,11)(3, -11) — and it matches the roots you would get from the Quadratic Formula calculator for the same equation.

Worked example — no linear term

Solve x24=0x^2 - 4 = 0. There is no xx term, so steps 3–6 are trivial: x2=4x^2 = 4, so x=±4=±2x = \pm\sqrt{4} = \pm 2. Vertex form is simply x24x^2 - 4, with vertex (0,4)(0, -4).

Why (b/2)² completes the square

Expand (x+b/2)2=x2+bx+(b/2)2(x + b/2)^2 = x^2 + bx + (b/2)^2. Compare that to x2+bxx^2 + bx — the only thing missing is the constant (b/2)2(b/2)^2. Adding it turns the expression into a perfect square, which is exactly why the method is called "completing" the square.

Common mistakes

  • Forgetting to divide by aa first when a1a \neq 1.
  • Adding (b/2)2(b/2)^2 to only one side — it must go on both sides to keep the equation balanced.
  • Squaring before halving — it is (b/2)2(b/2)^2, not b2/2b^2/2.
  • Dropping the ±\pm when taking the square root, which loses one of the two roots.

Vertex form and the quadratic formula

Vertex form a(xh)2+ka(x - h)^2 + k directly gives the vertex (h,k)(h, k) of the parabola — useful for graphing, and for optimization problems (maximum height, minimum cost, and so on). It is also where the quadratic formula comes from: complete the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0 and solving for xx reproduces the formula exactly, with h=b/(2a)h = -b/(2a) and k=cb2/(4a)k = c - b^2/(4a).

Where this shows up

Completing the square is the standard route to a parabola's vertex — the highest or lowest point of anything modeled by a quadratic: projectile height, profit curves, or the minimum of a cost function. It is also the technique behind deriving the general formula for solving any quadratic equation.

Frequently asked questions

What does 'completing the square' mean?
It means rewriting ax2+bx+cax^2 + bx + c so the variable terms form a perfect square binomial, a(xh)2+ka(x - h)^2 + k. Once the left side is a single squared term, you can take the square root of both sides and solve directly for xx.
Why do you add (b/2a)²?
Expanding (x+b/2)2(x + b/2)^2 gives x2+bx+(b/2)2x^2 + bx + (b/2)^2. So x2+bxx^2 + bx is only missing the constant (b/2)2(b/2)^2 to become a perfect square — adding it "completes" the square. You must add it to both sides of the equation to keep it balanced.
What do h and k mean in vertex form?
Vertex form is a(xh)2+ka(x - h)^2 + k. The point (h,k)(h, k) is the vertex of the parabola y=ax2+bx+cy = ax^2 + bx + c — its minimum point when a>0a > 0, or maximum when a<0a < 0. Completing the square is the standard way to find it.
Is completing the square the same as the quadratic formula?
Yes. Completing the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0 and solving for xx produces exactly the quadratic formula, x=b±b24ac2ax = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}. The formula is this method done once, symbolically, for every quadratic.
What if a is not 1?
Divide every term by aa first, so the x2x^2 coefficient is 1 — this is step 2 of the method. For example 2x212x+7=02x^2 - 12x + 7 = 0 becomes x26x+3.5=0x^2 - 6x + 3.5 = 0 before completing the square.
What happens when a = 0?
If a=0a = 0 the x2x^2 term disappears and the equation is linear (bx+c=0bx + c = 0), not quadratic — there is nothing to complete the square with. This calculator reports that case as "not quadratic"; enter a nonzero aa.

Related calculators