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.