Completing the Square Calculator

Vertex form
Convert ax² + bx + c to a(x − h)² + k form.
Next

Given a quadratic ax²+bx+c, completing the square rewrites it as a(x-h)²+k, revealing the parabola’s vertex (h, k) directly. Enter a, b and c and the calculator returns the vertex form a(x − h)² + k together with the vertex coordinates (h, k). Useful for calculus, physics (projectile motion), optimisation problems and algebra homework.

How completing the square works

  1. 1

    Enter coefficients a, b, c

    The quadratic ax² + bx + c. Enter decimals; a fraction such as 1/2 is typed as 0.5.

  2. 2

    Factor out a from the x² and x terms

    a(x² + (b/a)x) + c: separates the constant from the x-terms.

  3. 3

    Add and subtract (b/(2a))²

    Creates a perfect square: a(x² + (b/a)x + (b/(2a))²) − a(b/(2a))² + c.

  4. 4

    Collapse to vertex form

    a(x + b/(2a))² + (c − b²/(4a)) = a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a).

Worked example: 2x² + 8x + 5

Step 1, factor out a = 2 from x-terms: 2(x² + 4x) + 5

Step 2, half of 4 is 2, squared is 4. Add and subtract 4 inside: 2(x² + 4x + 4 − 4) + 5

Step 3, split into perfect square and leftover: 2((x + 2)² − 4) + 5

Step 4, distribute 2: 2(x + 2)² − 8 + 5

Step 5, simplify constant: 2(x + 2)² − 3

Vertex form: a = 2, h = −2, k = −3 → vertex at (−2, −3).

The general formula

For ax² + bx + c:

  • h = −b / (2a)
  • k = c − b² / (4a)
  • Vertex form: a(x − h)² + k

Why complete the square?

  • Find vertex instantly for parabola sketching.
  • Solve quadratic equations without the quadratic formula, especially useful for irrational roots.
  • Derive the quadratic formula itself: completing the square on ax² + bx + c = 0 produces x = (−b ± √(b² − 4ac)) / (2a).
  • Calculus: finding extrema of quadratics without taking derivatives.
  • Projectile motion: maximum height of a ball thrown upward is the k in vertex form of its height equation.
  • Circles and conic sections: completing the square on both x and y terms converts x² + y² + Dx + Ey + F = 0 to (x−h)² + (y−k)² = r², making centre and radius obvious.

Parabola geometry from vertex form

  • Vertex: (h, k).
  • Axis of symmetry: x = h.
  • Opens upward if a > 0, downward if a < 0.
  • Maximum or minimum value of the function: k.
  • Width: narrower for |a| > 1, wider for |a| < 1.
  • Roots (if real): x = h ± √(−k/a). Real only when k/a ≤ 0.

Common mistakes

  • Forgetting to distribute a after completing the square inside the parentheses. The correction term changes.
  • Sign errors on b/(2a): h = −b/(2a), not +b/(2a).
  • Not halving the middle coefficient before squaring. “Half of b over a, then square” is the canonical phrase.
  • Leaving a ≠ 1 buried: always factor it out first to simplify.

Special case: a = 1

When a = 1, the process simplifies:

  • x² + bx + c → (x + b/2)² + (c − b²/4)
  • h = −b/2, k = c − b²/4

Negative k means real roots

If k has the opposite sign of a, the parabola crosses the x-axis. Solve a(x − h)² = −k to find them.

Frequently Asked Questions

Completing the square directly exposes the vertex (graph shape), while the quadratic formula gives roots. Both have their uses: roots when you want where y = 0, vertex form when you want shape, maximum, minimum or axis of symmetry.

Enter coefficients as decimals; fractions such as 1/2 or 3/4 are typed as 0.5 or 0.75. Results are computed with the usual floating-point precision of a calculator.

This version handles quadratics in a single variable. For conic sections (circles, ellipses) in x and y, complete the square in each variable separately, the process is identical, applied twice.

Vertex form still works, the parabola just doesn’t cross the x-axis, so there are no real roots. The calculator still returns the vertex form and the vertex coordinates.

Related Tools