Skip to content
Calixo

Completing the Square Calculator

Rewrite ax² + bx + c = 0 as a perfect square (x + p)² = q, step by step — the technique behind the quadratic formula itself.

Inputs

Coefficient of x² (must be nonzero).

Coefficient of x.

Constant term.

Paste this into any page — the widget stays live and updates automatically as this calculator improves.

Saved Scenarios

— select 2+ to compare
Inputs updated · Results recalculated · Just now

p (in (x+p)²=q)

3.000

q (in (x+p)²=q)

7.000

x₁

-0.354

x₂

-5.646

Spark says

How it's calculated
A person writes mathematical equations by hand on grid paper using a pencil, promoting learning.
Photo by www.kaboompics.com on Pexels
Close-up of complex equations on a chalkboard, showcasing chemistry and math symbols.
Photo by Vitaly Gariev on Pexels

Formula

(x+b2a)2=(b2a)2ca\left(x+\dfrac{b}{2a}\right)^2 = \left(\dfrac{b}{2a}\right)^2 - \dfrac{c}{a}
p
— b/(2a) — half the normalized linear coefficient
q
— p² − c/a — the value the perfect square equals

What is the Completing the Square Calculator?

This calculator rewrites ax² + bx + c = 0 as a perfect square, (x + p)² = q, showing every intermediate algebraic step — the same technique the quadratic formula itself is derived from.

Use this when solving a quadratic by completing the square specifically (rather than the quadratic formula) for coursework, converting a quadratic into vertex form for graphing, or understanding exactly where the quadratic formula itself comes from.

How to use it

  1. 1 Enter the coefficient of x² (a) — it will be normalized to 1 automatically.
  2. 2 Enter the coefficient of x (b) and the constant term (c).
  3. 3 Read the resulting perfect-square form and the roots it produces.

Understanding Completing the Square Calculator

Completing the square is genuinely the method the quadratic formula is derived from, not a separate, unrelated technique — understanding this connection clarifies why both methods always produce identical roots for the same equation, and why completing the square is worth learning in its own right rather than treating the quadratic formula as the only tool that matters.

The core idea behind completing the square is to manipulate a quadratic expression into a perfect square trinomial — an expression of the form (x+p)², which expands to x² + 2px + p². Given a normalized equation x² + Bx + C = 0 (after dividing the original ax²+bx+c=0 through by a), the goal is to find the value of p that makes x² + Bx match the x² + 2px pattern — which requires 2p = B, so p = B/2. Adding and subtracting p² to the equation (a technique sometimes described as 'adding zero in a useful form,' since adding p² and immediately subtracting it changes nothing about the equation's actual value) allows the x² + Bx portion to be rewritten exactly as (x+p)² - p², turning the original equation into (x+p)² - p² + C = 0, which rearranges directly into the perfect-square form (x+p)² = p² - C.

Once in this form, solving for x becomes a simple square-root operation rather than requiring the full quadratic formula machinery: taking the square root of both sides gives x + p = ±√(p²-C), and subtracting p from both sides gives the final roots x = -p ± √(p²-C) — which, if you substitute back p = b/(2a) and C = c/a and simplify, is algebraically identical to the standard quadratic formula's x = (-b ± √(b²-4ac))/(2a). This isn't a coincidence or an approximation — completing the square, followed through symbolically on the general equation rather than specific numbers, is literally how the quadratic formula itself was originally derived, which is exactly why the two methods always agree on every quadratic equation, no exceptions.

Beyond just solving for roots, completing the square has a genuinely important second use that the quadratic formula alone doesn't directly provide: converting a quadratic function into vertex form. A quadratic written as a(x-h)² + k (vertex form) immediately reveals its vertex at (h, k) without needing any further calculation — and completing the square is exactly the algebraic technique that gets a quadratic from standard form (ax²+bx+c) into this vertex form. This is precisely why completing the square remains a genuinely important technique to know even for someone who could just use the quadratic formula for solving — it does something the formula alone doesn't hand you directly: a clean, immediately-readable expression for the parabola's vertex.

Completing the square also generalizes to problems well beyond quadratic equations specifically. The same core technique — manipulating an expression to expose a perfect square — shows up in deriving the formula for a circle's equation from its general form, in certain integration techniques in calculus, and in various optimization problems throughout algebra and beyond. Learning it as a genuine algebraic technique, rather than purely as an alternative path to the same roots the quadratic formula already provides, pays off in these other contexts where there's no equivalent 'just use the formula' shortcut available.

Worked examples

Advantages

  • Shows every intermediate step of the completing-the-square method, not just a final answer.
  • Produces the same roots as the quadratic formula, useful for cross-checking either method.
  • Directly gives vertex-form-adjacent values (p and q relate directly to the parabola's vertex).
  • Works for any nonzero a, automatically normalizing the equation first.

Limitations

  • Only real solutions are shown numerically — when q is negative, the true solutions are complex numbers.

Common mistakes

  • ⚠️ Forgetting to divide the constant term (c) by a along with the x² and x terms — all three terms need to be normalized by a, not just the ones with a variable.
  • ⚠️ Sign errors when moving the constant to the other side of the equation — since p² and -C combine with specific signs, a dropped negative sign produces a wrong q value.
  • ⚠️ Confusing p with a root — p is the value that shifts x in the perfect square, not a solution itself; the actual roots are -p plus or minus the square root of q.

Tips

  • 💡 How is completing the square different from the quadratic formula? They're the same underlying method — the quadratic formula is actually derived by completing the square on the general equation ax²+bx+c=0 and solving symbolically for x.
  • 💡 Use the p and q values directly for vertex form: the parabola's vertex is at (-p, -q) once the equation is written as a(x+p)² + (c - ap²) = 0 in expanded vertex form.
  • 💡 Double-check your normalization step (dividing by a) before proceeding — an error there propagates through every subsequent step.
  • 💡 If q comes out negative, that's a genuine result, not an error — it means the original equation has no real roots, matching what a negative discriminant would show in the standard quadratic formula.

Real-life uses

  • Solving a quadratic by completing the square specifically for coursework
  • Converting a quadratic into vertex form for graphing
  • Understanding exactly where the quadratic formula itself comes from
  • Deriving a parabola's vertex coordinates algebraically rather than reading them off a graph

Frequently asked questions

How is completing the square different from the quadratic formula?

They're the same underlying method — the quadratic formula is actually derived by completing the square on the general equation ax²+bx+c=0 and solving symbolically for x.

What do p and q represent?

After normalizing the equation to x²+Bx+C=0, p = B/2 and q = p² − C, so the equation becomes the perfect square (x+p)² = q — solving for x from there just requires a square root.

Why complete the square instead of just using the quadratic formula?

Completing the square directly produces vertex form, immediately revealing a parabola's vertex coordinates — something the quadratic formula alone doesn't hand you without extra calculation.

What does a negative q mean?

It means the equation has no real roots — only complex ones — matching exactly what a negative discriminant would indicate using the standard quadratic formula.

Does completing the square work for any quadratic?

Yes, as long as a (the coefficient of x²) is nonzero — the method normalizes the equation by dividing through by a first, so it works regardless of a's specific value.