Math & ScienceComplex roots

Quadratic Equation Solver

Enter the three coefficients of ax² + bx + c = 0. You get the discriminant first — because it tells you what kind of answer to expect — then the roots, the vertex and the factored form.

Coefficients

a cannot be zero — that would make the equation linear, not quadratic.

ROOTS
Discriminant (b² − 4ac)
Nature of the roots
Root 1
Root 2
Vertex
Axis of symmetry
Factored form
Sum / product of roots
The discriminant decides everything: positive gives two real roots, zero gives one repeated root, negative gives a conjugate pair of complex roots.
Share & embed

Read the discriminant before the roots

The quantity b² − 4ac sits under the square root in the quadratic formula, and its sign determines the entire character of the solution before you compute anything else. Positive means the parabola crosses the x-axis twice. Zero means it touches at exactly one point — a repeated root. Negative means it never touches the axis at all, and the roots are a complex conjugate pair. Checking the discriminant first tells you whether an answer with an imaginary part is a mistake or exactly what should happen.

Why complex roots are still shown

Many calculators simply report "no solution" when the discriminant is negative. That is misleading. There are always two roots; they just are not real numbers. In electrical engineering, control theory and signal processing, complex roots are the interesting case — they describe oscillation. Suppressing them hides the physics.

Vertex, axis and what they tell you

The vertex sits at x = −b / 2a, which is also the axis of symmetry. If a is positive the parabola opens upward and the vertex is the minimum; if a is negative it opens downward and the vertex is the maximum. This is the whole basis of solving optimisation problems with quadratics — maximum revenue, minimum cost, peak projectile height.

Numerical stability

When b² is much larger than 4ac, the textbook formula subtracts two nearly equal numbers for one of the roots, and floating-point arithmetic loses precision badly. This solver uses the numerically stable variant that computes the larger-magnitude root first and derives the other from the product of the roots, so results stay accurate even with wildly different coefficient scales.

Frequently Asked Questions

What does the discriminant tell me?
Its sign decides the nature of the roots. Positive gives two distinct real roots, zero gives one repeated real root, and negative gives a pair of complex conjugate roots. It is worth reading before the roots themselves.
Why does this show complex roots instead of "no solution"?
There are always two roots — a negative discriminant simply means they are not real. In engineering and signal processing complex roots describe oscillation and are often the case of interest, so hiding them loses information.
What is the vertex used for?
It sits at x = −b/2a and is the minimum of the parabola when a is positive, or the maximum when a is negative. That makes it the answer to optimisation questions such as peak height or maximum revenue.
Why can a not be zero?
If a is zero the x² term vanishes and the equation is linear, not quadratic. It still has a solution, but the quadratic formula divides by 2a and would be dividing by zero.