Quadratic Equation Solver

Solve ax² + bx + c = 0 with the discriminant, the vertex and the roots — complex ones included.

Runs entirely in your browser. Nothing is uploaded, logged or stored.

Roots

1 ; 2

What kind of solution
two distinct real roots
Discriminant (b² − 4ac)
1
Vertex of the parabola
(1.5, -0.25)
Axis of symmetry
x = 1.5

The discriminant decides everything: positive and there are two real roots, zero and there is one, negative and there are two complex ones. All three cases are answered here, including the last, which most calculators report as "no solution".

How it works

A negative discriminant does not mean there is no solution. It means there is none among the real numbers — there are two, and they are complex conjugates, mirror images either side of the real axis. Saying "no solution" is true only if you already know it means "no real solution", which is precisely what the reader who needs the answer does not yet know.

Setting a to zero is not an error either. It is a linear equation, bx + c = 0, and it has a perfectly good answer. Refusing it leaves the visitor to work out for themselves that they were not looking at a quadratic.

The roots are not computed with the textbook formula as written. When b is large and 4ac small, one of the two roots comes out as the difference of two nearly equal numbers and loses most of its significant digits. This computes the root that keeps its sign and derives the other from the product of the two, which is exact where the naive formula returns zero.

Examples

Case Input Result
Two real roots x² − 3x + 2 Δ = 1, roots 1 and 2
A double root x² + 2x + 1 Δ = 0, root −1
Complex roots x² + 1 Δ = −4, roots −i and +i
Not a quadratic at all 2x − 4 linear, root 2

Frequently asked questions

What does the discriminant actually tell me?

How many times the parabola crosses the horizontal axis. Positive: twice. Zero: it touches at the vertex and turns away. Negative: it never reaches the axis, which is why there is no real root and why the two complex ones share the same real part.

What is the i in the answer?

The imaginary unit, the number whose square is −1. A root like 2 + 3i is a genuine solution; substituting it back into the equation gives zero. It simply is not a point on the number line.

Why is the vertex useful?

It is the highest or lowest point of the curve, and the axis of symmetry runs vertically through it. Together they let you sketch the parabola from the coefficients without plotting anything.

Good to know

  • Coefficients may be decimals. The roots are shown to six decimal places, trailing zeros removed, so an exact answer looks exact.

All Mathematics tools