Quadratic Equation Solver
Real or complex roots of ax² + bx + c = 0.
Inputs
Loading calculator…
Calculating…
Was this helpful?
Formula
x = (−b ± √(b² − 4ac)) ÷ 2a
The discriminant D = b² − 4ac determines the nature of the roots. If D > 0 there are two distinct real roots; if D = 0 one repeated real root; if D < 0 the roots are complex conjugates.
Worked example
For x² − 5x + 6 = 0 the discriminant is 25 − 24 = 1, giving roots x = (5 ± 1) / 2 — that's x = 3 and x = 2, which you can verify by factoring (x − 2)(x − 3).
Where this can give the wrong answer
- Coefficient a must be non-zero — if a = 0 the equation is linear, not quadratic, and this calculator returns an error.
- When the discriminant is negative, roots are reported in the form (real part) ± (imaginary part)i — there are no real solutions.
- When D = 0 the two roots coincide — e.g. x² − 4x + 4 = 0 gives x = 2 twice (a perfect square).
FAQ
- The parabola y = ax² + bx + c never crosses the x-axis — it sits entirely above or below it. The complex roots still exist mathematically but aren't real numbers you can plot on a standard number line.