Completing the Square Calculator
Convert ax² + bx + c to vertex form a(x−h)² + k. Full step-by-step solution, vertex, and axis of symmetry shown.
Enter a, b, and c for ax² + bx + c. The calculator converts it to vertex form a(x−h)²+k, showing every step of the process and the resulting vertex and axis of symmetry.
What is completing the square?
Completing the square is a technique for rewriting a quadratic from standard form, ax² + bx + c, into vertex form, a(x − h)² + k. The two forms describe the exact same parabola — vertex form just makes the vertex (h, k) visible at a glance instead of buried inside the coefficients.
The name comes from the middle of the process: a quadratic expression like x² + bx is missing a constant term that would make it a perfect square trinomial — one that factors as (x + something)². Completing the square means adding (and then immediately subtracting, to keep the expression unchanged) exactly the right constant to “complete” that missing piece.
Vertex form is useful well beyond just locating the vertex — it’s also how the quadratic formula itself is originally derived, and it makes graphing, finding the axis of symmetry, and identifying the maximum or minimum value of a quadratic function far more direct than working from standard form alone. Every quadratic has both forms available; converting between them is purely a matter of algebraic rearrangement, not a change in what function is being described. A parabola graphed from ax² + bx + c and the same parabola graphed from its equivalent a(x − h)² + k form are pixel-for-pixel identical — vertex form simply exposes information that standard form leaves implicit in a combination of coefficients.
The vertex formula
Completing the square on the general form ax² + bx + c produces a direct formula for h and k, which this calculator uses to compute the final answer:
These two formulas are worth recognizing on sight: h = −b/(2a) is exactly the same expression that gives the axis of symmetry of a parabola, and it’s also the “−b/(2a)” term that sits in the middle of the quadratic formula. Completing the square is, in a real sense, where that formula comes from in the first place.
Reading the vertex geometrically
Once a quadratic is in vertex form, its graph can be sketched almost by inspection. The vertex (h, k) is the single turning point of the parabola — its lowest point if a is positive, or its highest point if a is negative. The value of a also controls how narrow or wide the parabola is: a larger |a| produces a narrower, steeper curve, while a smaller |a| produces a wider, flatter one, exactly as it does in standard form.
| Sign of a | Parabola opens | Vertex is a... |
|---|---|---|
| Positive | Upward | Minimum point |
| Negative | Downward | Maximum point |
The axis of symmetry — the vertical line the parabola is mirror-symmetric across — is simply x = h, read directly off the vertex form without any further calculation. This is often the single most useful piece of information vertex form provides over standard form, since standard form requires computing −b/(2a) separately to get the same value.
Step-by-step process
- Factor a out of the x² and x terms only, leaving the constant c outside. If a = 1, this step does nothing and can be skipped.
- Take half of the coefficient of x inside the parentheses (that’s b/a, so half of it is b/(2a)), and square that value.
- Add and subtract that squared value inside the parentheses. This changes nothing about the expression’s value, since adding and subtracting the same amount cancels out — but it sets up a perfect square trinomial.
- Rewrite the perfect square trinomial as a squared binomial, and move the leftover “subtracted” piece (multiplied back through by a) outside the parentheses to join the constant.
- Read off h and k from the resulting a(x − h)² + k form.
Worked example: a = 1
Complete the square for x² − 6x + 5.
Step 1 doesn’t apply, since a = 1. Step 2: half of −6 is −3, and (−3)² = 9. Step 3: add and subtract 9: x² − 6x + 9 − 9 + 5. Step 4: the first three terms factor as (x − 3)², leaving −9 + 5 = −4 outside:
Reading off the vertex form directly: h = 3, k = −4, matching the vertex formula h = −b/(2a) = −(−6)/2 = 3 and k = c − b²/(4a) = 5 − 36/4 = −4.
Worked example: a ≠ 1
Complete the square for 2x² + 8x + 3.
Step 1: factor 2 out of the first two terms: 2(x² + 4x) + 3. Step 2: half of 4 is 2, and 2² = 4. Step 3: add and subtract 4 inside the parentheses: 2(x² + 4x + 4 − 4) + 3. Step 4: factor the perfect square and move the leftover term out, multiplying it back by the factored-out a = 2: 2(x + 2)² − 8 + 3 = 2(x + 2)² − 5.
This example is worth studying closely because of the subtraction step: the “−4” inside the parentheses gets multiplied by the factored-out 2 when it moves outside (2 × −4 = −8), which is a detail that’s easy to lose track of when a isn’t 1.
Worked example: negative a
Complete the square for −x² + 4x + 1.
Step 1: factor −1 out of the first two terms: −(x² − 4x) + 1. Step 2: half of −4 is −2, and (−2)² = 4. Step 3: add and subtract 4 inside the parentheses: −(x² − 4x + 4 − 4) + 1. Step 4: factor the perfect square, and carefully multiply the leftover −4 by the factored-out −1 when moving it outside: −(x − 2)² − (−1 × 4) + 1 = −(x − 2)² + 4 + 1 = −(x − 2)² + 5.
Checking against the vertex formula: h = −b/(2a) = −4/(2×−1) = 2, and k = c − b²/(4a) = 1 − 16/(−4) = 1 + 4 = 5 — both match. This example is a useful one to practice specifically because negative values of a require extra care with signs at every single step, not just the final one.
Why h uses a minus sign
A detail that trips people up: the vertex formula gives h = −b/(2a), with a minus sign built in, even though the completed expression inside the parentheses often reads as “x + something.” The resolution is that “x + (something)” and “x − h” are the same statement whenever h itself is negative — (x − h) with h = −3 is literally x − (−3), which simplifies to x + 3.
| Sign of b | Sign of h = −b/(2a) | How the binomial reads |
|---|---|---|
| Positive | Negative | "x + (positive number)" |
| Negative | Positive | "x − (positive number)" |
| Zero | Zero | Just "x" |
The underlying formula a(x − h)² + k never changes — only which sign ends up visible in the simplified binomial does, depending on the sign of h itself. Getting this backwards (writing “x − half” using the un-negated b/(2a) value directly, instead of correctly negating it to get h) is a subtle sign error that produces a binomial with exactly the wrong sign — worth watching for closely in any hand-worked solution.
Checking your answer
The fastest check is to expand the vertex form back out and confirm it matches the original standard form. Using the a ≠ 1 example above, 2(x + 2)² − 5 expands as: 2(x² + 4x + 4) − 5 = 2x² + 8x + 8 − 5 = 2x² + 8x + 3 — which matches the original 2x² + 8x + 3 exactly.
A second, faster check: plug a single convenient x-value, such as x = 0, into both the original standard form and the vertex form, and confirm the two outputs agree. At x = 0: the standard form gives 2(0)² + 8(0) + 3 = 3. The vertex form gives 2(0+2)² − 5 = 2(4) − 5 = 3. They match.
Common mistakes to avoid
Forgetting to multiply the subtracted term by a when moving it outside the parentheses. When a ≠ 1, the ”− (half)²” term that gets pulled out of the parentheses has to be multiplied by a first, since it was inside a set of parentheses that a was factoring. Pulling it out unchanged (without the multiplication) is one of the most common arithmetic slips in this topic.
Getting the sign of h backwards. As covered above, h = −b/(2a) always includes a negative sign relative to b/(2a). Writing the vertex form using the un-negated value produces a binomial with the wrong sign — correct on the surface (same numbers involved) but describing a parabola shifted to the opposite side of the y-axis from the real one.
Only completing the square inside the parentheses, and forgetting the “subtract” half. Adding the squared value without also subtracting it changes the value of the expression, which is not allowed — the whole point of adding-and-subtracting the same number is that it’s a legal, value-preserving rewrite.
Skipping the factor-out step when a ≠ 1. Trying to complete the square directly on ax² + bx without first factoring out a leads to fractions and sign errors that are much easier to avoid by factoring a out first, even when a is a “nice” number like 2 or 3.
Mishandling the sign when a is negative. As the third worked example above shows, a negative a means every sign in the process needs extra attention — the leftover term inside the parentheses gets multiplied by a negative number when it moves outside, which flips its sign relative to what a positive-a problem would produce at the same step.
Real-world applications
Projectile motion and optimization. A projectile’s height over time is often modeled by a downward-opening quadratic; completing the square directly reveals the maximum height (k) and the time it occurs (h) without needing calculus, since the vertex of a downward-opening parabola is exactly its highest point.
Business: maximizing profit or revenue. When profit is modeled as a quadratic function of price or quantity, completing the square identifies the exact price point that maximizes profit (h) and what that maximum profit actually is (k), directly from the model’s coefficients.
Engineering: minimizing material or cost. Many optimization problems in engineering and design reduce to minimizing a quadratic cost function; completing the square finds that minimum directly, which is often faster and more transparent than other optimization methods for a problem that’s genuinely quadratic.
Deriving the quadratic formula itself. Applying completing the square to the fully general ax² + bx + c = 0, then solving for x, is the standard derivation of the quadratic formula — anyone comfortable with the process in this article already understands, at least in outline, where that famous formula actually comes from.