terican

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.

FreeInstantNo signupOpen source

Inputs

Selected Output (h, k, discriminant, or root)

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Selected Output (h, k, discriminant, or root)

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

Frequently asked questions

What does it mean to complete the square on a quadratic expression?
Completing the square algebraically rewrites ax² + bx + c into vertex form a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a). This equivalent form exposes the parabola's vertex coordinates directly, making it straightforward to identify the axis of symmetry at x = h, the minimum or maximum output value k, and the equation's roots — all without trial-and-error factoring.
How do you solve a quadratic equation by completing the square step by step?
Begin with ax² + bx + c = 0. Factor out a from the first two terms to get a(x² + (b/a)x) = −c. Add the square of half the inner coefficient, (b/(2a))², to both sides, then write the left side as a perfect square: a(x + b/(2a))² = b²/(4a) − c. Divide by a and take the square root of both sides. For example, x² + 4x − 5 = 0 becomes (x + 2)² = 9, giving roots x = 1 and x = −5.
What do h and k represent geometrically in the vertex form of a parabola?
In the vertex form a(x − h)² + k, the pair (h, k) is the exact vertex of the parabola. The value h is the x-coordinate of the turning point and defines the axis of symmetry x = h, while k is the y-coordinate and equals the function's global minimum when a > 0 or global maximum when a < 0. For 3x² − 12x + 7, for instance, h = 2 and k = −5, placing the vertex at (2, −5).
When should completing the square be used instead of the quadratic formula?
Completing the square is the better choice when the goal is to produce vertex form for graphing a parabola, solve an optimization problem requiring the minimum or maximum value, or understand how the quadratic formula is derived. The quadratic formula is faster for pure numerical root-finding. However, completing the square is indispensable in calculus for integrating rational functions, in analytic geometry for identifying conic sections, and whenever the vertex coordinates carry direct physical meaning.
Does completing the square work when the leading coefficient a is not equal to 1?
Yes, completing the square works for any non-zero value of a. The process begins by factoring a out of the quadratic and linear terms: ax² + bx + c = a(x² + (b/a)x) + c. The square is then completed on the expression inside the parentheses. For example, 2x² + 8x + 3 factors as 2(x² + 4x) + 3, then becomes 2(x + 2)² − 5 after adding and subtracting 4 inside the bracket. The formulas h = −b/(2a) and k = c − b²/(4a) handle any non-zero a automatically.
How is the discriminant connected to completing the square?
Applying completing the square to the general equation ax² + bx + c = 0 produces the quadratic formula x = (−b ± √(b² − 4ac)) / (2a). The expression under the square root, b² − 4ac, is the discriminant. A positive discriminant indicates two distinct real roots, a discriminant of zero means one repeated root, and a negative discriminant means the two roots are complex conjugates with no real solutions. Completing the square is therefore the algebraic proof behind both the formula and the discriminant classification rule.