🔲 Completing the Square Calculator – Vertex Form, Roots & Step-by-Step
Completing the squareis one of algebra's most versatile techniques. It transforms any quadratic expression ax² + bx + c into the elegant vertex form a(x − h)² + k, unlocking the geometry of the parabola — vertex, axis of symmetry, minimum or maximum value — all at a glance. This calculator performs the full derivation for you, shows every algebraic step, solves the equation, and handles integer, decimal, and fractional coefficients.
📐 What Is Completing the Square?
A quadratic expression in standard form ax² + bx + c hides the shape of its parabola inside the coefficients. The completing-the-square technique rearranges the expression around a perfect-square trinomial — a trinomial of the form (x + d)² — revealing the turning point directly.
The core idea: adding and immediately subtracting the same quantity (b/2a)² inside the expression leaves its value unchanged, yet creates the perfect square needed to factor cleanly.
📊 The Completing-the-Square Formula
General algorithm for ax² + bx + c:
- If
a ≠ 1, factorafrom the quadratic terms:a(x² + (b/a)x) + c - Add and subtract
(b/2a)²inside the parentheses to form a perfect-square trinomial. - Rewrite the trinomial as a square:
(x + b/2a)² - Simplify the remaining constant:
k = c − b²/(4a) - Result:
a(x − h)² + kwhereh = −b/(2a)
📋 Key Outputs Explained
| Output | Formula | Meaning |
|---|---|---|
| Vertex form | a(x − h)² + k | Completed-square representation |
| Vertex (h, k) | h = −b/(2a), k = c − b²/(4a) | Turning point of the parabola |
| Axis of symmetry | x = h | Vertical line of symmetry |
| Discriminant Δ | b² − 4ac | Determines root type |
| Roots | x = h ± √(−k/a) | Solutions of ax² + bx + c = 0 |
🧮 Worked Example: 2x² − 8x + 5
Start with a = 2, b = −8, c = 5.
- Factor out 2 from the quadratic terms:
2(x² − 4x) + 5 - Compute
(b/2a)² = (−8/4)² = (−2)² = 4. Add and subtract 4 inside:2(x² − 4x + 4 − 4) + 5 - Separate:
2(x² − 4x + 4) − 2×4 + 5 = 2(x − 2)² − 8 + 5 - Final vertex form:
2(x − 2)² − 3 - Vertex
(2, −3), axisx = 2, minimum value−3.
📌 When to Use Completing the Square
Completing the square shines in a variety of academic and real-world contexts:
- Graphing parabolas — vertex form gives you everything needed to sketch the curve: location, orientation, and width.
- Solving quadratic equations — isolating the squared term and taking square roots avoids factoring when roots are irrational.
- Deriving the quadratic formula — applying the technique to
ax² + bx + c = 0in general produces the familiarx = (−b ± √Δ) / (2a)formula. - Optimization problems — the vertex immediately gives the minimum cost, maximum revenue, or peak height in applied problems.
- Conic sections — converting circle and ellipse equations to standard form uses the same technique on x² and y² terms simultaneously.
🔢 Fraction and Decimal Coefficients
The calculator accepts fractional coefficients such as 3/2 or −5/4 alongside integers and decimals. The computation carries exact rational arithmetic throughout — (b/2a)² is kept as a fraction where possible — so the displayed steps match what you would write on paper. Decimal approximations appear only in the final numeric outputs and only to the precision you select.
📈 Understanding the Discriminant
The discriminant Δ = b² − 4ac classifies the roots without computing them:
Δ > 0— two distinct real roots; the parabola crosses the x-axis twice.Δ = 0— one repeated real root; the parabola is tangent to the x-axis.Δ < 0— no real roots; the parabola sits entirely above or below the x-axis. Roots are complex conjugates.
In vertex-form terms, the vertex y-coordinate k tells the same story: if a > 0 and k > 0, the parabola opens upward and lies entirely above the x-axis (no real roots); if k < 0, it crosses twice.
🎓 Educational Value
Enabling the step-by-step mode displays the full chain of algebraic transformations, from standard form through factoring, adding and subtracting the completing term, separating the perfect square, simplifying the constant, and arriving at vertex form. This mirrors the derivation taught in algebra courses and helps students verify hand-written work, understand where each term originates, and build confidence with the method before exams.