Does completing the square always work for quadratic equations?

Enter the coefficients of ax² + bx + c = 0 to see the completed-square (vertex) form and both roots — real or complex — which is the direct proof that completing the square always works whenever a ≠ 0.

Quick Facts

Formula
ax² + bx + c = a(x − h)² + k, with h = −b/(2a) and k = c − b²/(4a)
Both h and k are always defined whenever a ≠ 0 — that's why the method never fails.
Discriminant
b² − 4ac decides the root type
Positive → two real roots. Zero → one repeated root. Negative → two complex roots.

Your Results

Calculated
Vertex (completed-square) form
-
a(x − h)² + k
Root x₁
-
First solution
Root x₂
-
Second solution
Discriminant (b² − 4ac)
-
Determines root type

Ready

Enter a, b, and c, then press Calculate.

Does completing the square always work?

Yes. For any quadratic equation ax² + bx + c = 0 with a ≠ 0, completing the square always succeeds in rewriting the equation and always produces the correct roots — real or complex. Unlike factoring by inspection, which only works cleanly when the roots happen to be rational, completing the square is a direct algebraic manipulation that has no such restriction. This calculator performs that manipulation on your coefficients so you can see exactly why it always works.

Formula and method

Starting from ax² + bx + c = 0, divide through by a, move the constant term aside, add and subtract the square of half the x-coefficient, and factor the resulting perfect-square trinomial. The result is the completed-square (vertex) form:

a(x − h)² + k, where h = −b / (2a) and k = c − b² / (4a)

Because division by a and squaring b/(2a) are defined for every real a ≠ 0 and every real b, h and k always exist. Setting a(x − h)² + k = 0 and solving for x gives the roots:

x = h ± √(−k / a), which is algebraically identical to the quadratic formula x = (−b ± √(b² − 4ac)) / (2a)

The quantity under the square root, the discriminant D = b² − 4ac, decides what kind of roots you get, but it never stops the method from running:

  • D > 0: two distinct real roots.
  • D = 0: one repeated real root (the vertex touches the x-axis).
  • D < 0: two complex conjugate roots, h ± qi where q = √(−D) / (2a). Completing the square still works — it just reveals that no real number solves the equation.

Common sources of error

  • Forgetting to divide by a: when a ≠ 1, both the b/2 and the constant term must be handled relative to a — skipping this is the single most common mistake.
  • Sign errors on b: h = −b/(2a), so a positive b gives a negative h. Losing the sign flips the vertex to the wrong side of the y-axis.
  • Stopping at a negative number under the root: a negative discriminant does not mean the method failed — it means the roots are complex, not that there is no answer.

Checking your result

Expand a(x − h)² + k back out — it should match your original a, b, and c exactly. You can also plug either root back into ax² + bx + c and confirm it evaluates to 0 (or, for complex roots, that the real and imaginary parts cancel correctly).

Applications

Completing the square is not just a solving technique. It also converts a parabola's equation into vertex form for graphing (h, k is the vertex), it is the standard derivation of the quadratic formula, and the same add-and-subtract trick is used in calculus, conic sections (circles, ellipses), and integration.

Frequently Asked Questions

Does completing the square always work for any quadratic equation?
Yes, as long as a is not 0. Completing the square is a pure algebraic rearrangement — adding and subtracting (b/2a)² — and that step is valid for every real coefficient, whether the roots end up rational, irrational, or complex. Unlike factoring by inspection, it never depends on the numbers being "nice".
What is the completed-square (vertex) form?
Any quadratic ax² + bx + c can be rewritten as a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a). Both h and k are always defined whenever a is not 0, which is exactly why the method always succeeds.
What happens when the discriminant is negative?
Completing the square still works. It produces two complex conjugate roots, h ± qi, where q equals the square root of (4ac − b²) divided by 2a. The method does not fail — it simply shows there is no real-number solution.
How is completing the square related to the quadratic formula?
The quadratic formula, x = (−b ± √(b² − 4ac)) / (2a), is derived by completing the square on the general equation ax² + bx + c = 0. That derivation is exactly why the quadratic formula also always works.