Math

Quadratic Equation Calculator

Enter the coefficients a, b, and c from a quadratic equation in the form ax² + bx + c = 0 to solve for x using the quadratic formula — including complex roots when the discriminant is negative.

ax² + bx + c = 0

Solutions for x
Enter a, b, and c to solve.

How the Quadratic Equation formula works

The quadratic formula:

x = ( −b ± √(b² − 4ac) ) / (2a)

The discriminant, b² − 4ac, determines the nature of the roots: positive gives two real roots, zero gives one repeated real root, and negative gives two complex conjugate roots.

Step-by-step calculation

  1. Calculate the discriminant: b² − 4ac.
  2. If the discriminant is zero or positive, take its square root.
  3. Apply the ± in the formula to get one or two real roots.
  4. If the discriminant is negative, express the square root of its absolute value as an imaginary component instead.

Worked example

For x² − 5x + 6 = 0 (a=1, b=−5, c=6): discriminant = 25 − 24 = 1. x = (5 ± 1) / 2, giving x = 3 or x = 2.

Frequently asked questions

What does a negative discriminant mean?

It means the equation has no real solutions — the parabola never crosses the x-axis — but it does have two complex (imaginary) roots, which the calculator will show in the form a ± bi.

What if 'a' is zero?

If a = 0, the equation isn't actually quadratic anymore — it becomes linear (bx + c = 0), which has at most one solution and needs a different approach to solve.

Can this handle non-integer coefficients?

Yes — a, b, and c can be any real numbers, including decimals and negative values.