Skip to content
Other

Completing the Square Calculator

Enter the coefficients a, b, and c of your quadratic equation ax² + bx + c = 0. The calculator shows every step of completing the square, rewrites the equation in vertex form, finds the roots (real or complex), and identifies the vertex and axis of symmetry. Negative discriminants are handled with complex-number notation.

Your details

The leading coefficient. Must not be zero.
The coefficient of the linear term.
The constant term.
Vertex formTwo real roots
(x + 3)² - 16 = 0

The equation rewritten as a(x - h)^2 + k = 0

Root x₁x = 1
Root x₂x = -7
Discriminant (b² - 4ac)64
Vertex (h, k)(-3, -16)
Axis of symmetryx = -3
Nature of rootsTwo distinct real roots
_disc64
_h-3
_k-16
64
Complex roots<-0.001Repeated root-0.001-0.001Two real roots0.001+

Vertex form: (x + 3)² - 16 = 0

  • The parabola opens upward (a = 1 is positive).
  • The vertex is at (-3, -16), which is the minimum point.
  • The discriminant is 64 (positive), confirming two distinct real roots.

Next stepYou can verify the roots by substituting them back into the original equation.

Formula

ax2+bx+c=a(x+b/(2a))2+(c−b2/(4a))=0,yieldingx=−b/(2a)+/−sqrt(b2−4ac)/(2a)ax^2 + bx + c = a(x + b/(2a))^2 + (c - b^2/(4a)) = 0, yielding x = -b/(2a) +/- sqrt(b^2 - 4ac)/(2a)

Worked example

For x^2 + 6x - 7 = 0 (a=1, b=6, c=-7): (b/2)^2 = (6/2)^2 = 9. Add 9 to both sides: x^2 + 6x + 9 = 7 + 9 = 16. Factor: (x + 3)^2 = 16. Take square root: x + 3 = +/-4. So x = 1 or x = -7.

What is completing the square?

Completing the square is an algebraic technique for rewriting a quadratic expression ax^2 + bx + c in the form a(x - h)^2 + k. The transformed form is called vertex form because h and k are the coordinates of the parabola's vertex. The method works for every quadratic, regardless of whether the discriminant is positive, zero, or negative, and it is the algebraic foundation from which the quadratic formula is derived. Unlike factoring, which only works neatly when the roots happen to be rational numbers, completing the square always produces an exact answer.

How to complete the square (step-by-step)

Start with ax^2 + bx + c = 0. If a is not 1, divide every term by a to get x^2 + (b/a)x + (c/a) = 0. Move the constant to the right: x^2 + (b/a)x = -(c/a). Compute the completing value: take half the coefficient of x, then square it - that is (b/(2a))^2. Add this value to both sides. The left side is now a perfect square trinomial that factors as (x + b/(2a))^2. Take the square root of both sides and solve for x, giving x = -b/(2a) +/- sqrt((b/(2a))^2 - c/a). This is exactly the quadratic formula.

Vertex form and the parabola

Once a quadratic is in vertex form a(x - h)^2 + k, you can read off the parabola's key features instantly. The vertex (h, k) is the highest or lowest point depending on whether a is negative or positive. The axis of symmetry is the vertical line x = h. The y-intercept remains c (set x = 0 in the original equation). The roots, where the parabola crosses the x-axis, come from setting vertex form equal to zero: (x - h)^2 = -k/a, then x = h +/- sqrt(-k/a). When -k/a is negative the parabola never crosses the x-axis and the roots are complex.

Common uses and applications

Completing the square appears throughout algebra, calculus, geometry, and physics. In coordinate geometry it converts the general form of a circle or ellipse (x^2 + y^2 + Dx + Ey + F = 0) into centre-radius form. In calculus it simplifies integration of rational functions by reducing the denominator to a recognisable square-plus-constant form. In physics it is used to find the maximum height or range of a projectile. In computer graphics it locates the extremes of quadratic bezier curves. Any time you need to find a minimum, maximum, or the exact roots of a quadratic without a calculator, completing the square gives an exact closed-form answer.

Discriminant and nature of roots

Discriminant valueNature of rootsParabola behavior
b^2 - 4ac > 0 Two distinct real roots Crosses the x-axis at two points
b^2 - 4ac = 0 One repeated real root Touches the x-axis at exactly one point
b^2 - 4ac < 0 Two complex (non-real) roots Does not cross the x-axis

The discriminant b^2 - 4ac determines how many real solutions a quadratic has.

Frequently asked questions

Why do we add (b/2a)^2 to both sides?

To turn the left side into a perfect square trinomial. A perfect square (x + p)^2 expands to x^2 + 2px + p^2, so the coefficient of x is 2p and the constant is p^2. Given x^2 + (b/a)x, we identify 2p = b/a, so p = b/(2a) and p^2 = (b/(2a))^2. Adding p^2 to both sides keeps the equation balanced while making the left side factorable as (x + p)^2.

What if the coefficient a is not 1?

Divide every term by a first, so the leading coefficient becomes 1. Then proceed with the standard steps. Alternatively, factor a out of the first two terms - a(x^2 + (b/a)x) - then complete the square inside the parentheses. Either way you get a(x - h)^2 + k. This calculator handles any non-zero value of a automatically.

What does a negative discriminant mean?

When b^2 - 4ac is negative, the square root gives an imaginary number, so the two roots are complex numbers of the form h + qi and h - qi, where q = sqrt(|disc|) / (2|a|). The parabola does not cross the x-axis at all. These complex roots still obey all the usual rules of algebra and are genuinely useful in engineering, signal processing, and physics.

Is completing the square the same as the quadratic formula?

The quadratic formula is derived by completing the square on the general form ax^2 + bx + c = 0. So the two methods always give the same numerical answer. Completing the square is more flexible because it also gives you the vertex form directly, whereas the quadratic formula gives only the roots. For teaching and understanding the structure of a parabola, completing the square is the preferred approach.

Can I complete the square for expressions with two variables?

Yes. For example, x^2 + y^2 + 6x - 4y + 4 = 0 can be rearranged as (x^2 + 6x) + (y^2 - 4y) = -4, then completed separately to (x + 3)^2 - 9 + (y - 2)^2 - 4 = -4, giving (x + 3)^2 + (y - 2)^2 = 9, a circle centred at (-3, 2) with radius 3. This is a fundamental technique in analytic geometry.

How do I check my answer?

Substitute each root back into the original equation: if ax^2 + bx + c = 0 is satisfied, the root is correct. You can also expand the vertex form a(x - h)^2 + k and confirm it equals the original quadratic. Both checks should always agree.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…