Last verified · v1.0
Calculator · math
Completing The Square Calculator
Convert any quadratic ax²+bx+c to vertex form a(x−h)²+k. Instantly compute vertex coordinates, roots, and discriminant by completing the square.
Inputs
Selected Output (h, k, discriminant, or root)
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
What Is Completing the Square?
Completing the square is an algebraic technique that rewrites any quadratic expression ax² + bx + c into vertex form a(x − h)² + k. This transformation reveals the parabola's vertex coordinates (h, k) directly and provides the algebraic foundation for deriving the quadratic formula, solving equations, and graphing parabolas with precision.
The Core Formula
Given a quadratic ax² + bx + c, the equivalent vertex form is:
ax² + bx + c = a(x − h)² + k
The two vertex coordinates are calculated as:
- h = −b / (2a) — the x-coordinate of the vertex and the axis of symmetry
- k = c − b² / (4a) — the y-coordinate of the vertex, representing the minimum or maximum of the function
Step-by-Step Derivation
Starting from ax² + bx + c, factor out a from the first two terms:
a(x² + (b/a)x) + c
Add and subtract the square of half the inner linear coefficient inside the parentheses:
a(x² + (b/a)x + b²/(4a²) − b²/(4a²)) + c
Group the perfect-square trinomial and distribute a over the subtracted term:
a(x + b/(2a))² − b²/(4a) + c
Substituting h = −b/(2a) and k = c − b²/(4a) yields the compact vertex form a(x − h)² + k. This derivation is documented by Wikipedia: Completing the Square and verified by Wolfram MathWorld: Completing the Square.
Understanding the Variables
- a — Leading Coefficient: Controls parabola direction and width. A positive a opens upward; negative a opens downward. Must be non-zero or the expression is not quadratic.
- b — Linear Coefficient: Governs horizontal shift. Combined with a, it determines the axis of symmetry x = −b/(2a).
- c — Constant Term: The y-intercept of the parabola (value when x = 0).
- h — Vertex x-Coordinate: Found via h = −b/(2a). Defines the horizontal position of the turning point.
- k — Vertex y-Coordinate: Found via k = c − b²/(4a). Equals the function's minimum (a > 0) or maximum (a < 0).
Worked Example 1 — Simple Case (a = 1)
Rewrite x² + 6x + 5 in vertex form and find the roots.
- a = 1, b = 6, c = 5
- h = −6 / (2 × 1) = −3
- k = 5 − 36/4 = 5 − 9 = −4
- Vertex form: (x + 3)² − 4
- Roots: (x + 3)² = 4 → x + 3 = ±2, giving x = −1 or x = −5
Worked Example 2 — Leading Coefficient ≠ 1
Rewrite 2x² − 4x + 1 in vertex form.
- a = 2, b = −4, c = 1
- h = −(−4) / (2 × 2) = 4/4 = 1
- k = 1 − 16/8 = 1 − 2 = −1
- Vertex form: 2(x − 1)² − 1
- Vertex at (1, −1); roots at x = 1 ± √(0.5) ≈ 1.707 and 0.293
Finding Roots and the Discriminant
Setting a(x − h)² + k = 0 and solving gives x = h ± √(−k/a). The discriminant Δ = b² − 4ac summarizes root behavior: Δ > 0 yields two distinct real roots, Δ = 0 yields one repeated root, and Δ < 0 yields two complex conjugate roots. As explained by OpenStax Algebra and Trigonometry, completing the square is the formal algebraic basis from which the quadratic formula is derived.
Practical Applications
- Graphing parabolas: Vertex form immediately locates the turning point without plotting multiple points.
- Optimization: Physics projectile problems and economic cost-minimization models depend on finding vertex coordinates precisely.
- Conic sections: The same method converts general circle and ellipse equations into standard form.
- Calculus integration: Completing the square simplifies integrals of rational functions with quadratic denominators.
Reference