Completing the Square Calculator
Turn ax² + bx + c into vertex form a(x − h)² + k, with the vertex coordinates shown.
Why Rewrite a Quadratic This Way
Standard form (ax² + bx + c) is great for reading off coefficients, but it hides two things people often need: where the parabola’s vertex is, and how to derive the roots without memorizing a separate formula. Vertex form a(x − h)² + k answers both at once — the vertex sits right at the point (h, k), and setting the expression to 0 and unwinding it algebraically is, step for step, exactly how the quadratic formula gets derived in the first place.
Completing the square isn’t a separate, unrelated technique from the quadratic formula — it’s the technique the formula comes from. Once you’ve done it by hand a few times, the formula stops looking like something to memorize and starts looking like a shortcut for a process you already understand.
The transformation
where h = −b/2a and k = c − b²/4a
Two Worked Examples
Example 1 — leading coefficient of 1
Step 1. Since a = 1, there’s nothing to factor out of the first two terms yet: keep (x² + 6x) + 5.
Step 2. Take half of 6 (the x-coefficient), then square it: (3)² = 9.
Step 3. Add and subtract 9 inside: (x² + 6x + 9) − 9 + 5. The first three terms are now a perfect square trinomial: (x + 3)² − 4.
Vertex form: (x + 3)² − 4, vertex at (−3, −4). Setting this to 0 gives (x + 3)² = 4, so x + 3 = ±2, meaning x = −1 or x = −5 — the same roots you’d get from the quadratic formula or by factoring (x + 1)(x + 5).
Example 2 — leading coefficient other than 1
Step 1. Factor 2 out of the first two terms only: 2(x² − 4x) + 3.
Step 2. Half of −4 is −2, squared is 4. Add and subtract 4 inside the parentheses — since everything in there is multiplied by 2, adding 4 there actually adds 8 overall, so 8 has to come back out to balance it: 2(x² − 4x + 4) − 8 + 3.
Step 3. Simplify: 2(x − 2)² − 5.
Vertex form: 2(x − 2)² − 5, vertex at (2, −5). This example is exactly why the leading coefficient trips people up — the amount you “give back” outside the parentheses depends on a, not just the number you squared.
Common Mistakes
- Forgetting to factor a out first. If a ≠ 1, you can’t take half the x-coefficient correctly until the first two terms are factored by a.
- Only subtracting the squared value, not accounting for a. When a ≠ 1, whatever you add inside the parentheses gets multiplied by a — you have to subtract a times that amount outside, not just the raw squared number.
- Mixing up the sign of h. The vertex form uses (x − h), so if your binomial reads (x + 3), that means h = −3, not 3 — an easy sign flip to miss when reading off the vertex coordinates.
- Assuming every quadratic gives real vertex-form roots. If k and a end up with the same sign, setting the expression to 0 requires a negative square root — those are complex roots, not a mistake in the algebra.
