Quadratic Equation Solver (ax² + bx + c)

Solve any quadratic equation with the quadratic formula — real or complex roots, the discriminant, the vertex, and a step-by-step worked example.

For an equation in the form ax² + bx + c = 0.

Roots
Discriminant (b² − 4ac)
Nature of roots
Vertex
Factored form

Solving quadratic equations

A quadratic equation is any equation that can be written as ax² + bx + c = 0 with a ≠ 0. Its solutions — the values of x that make it true — are called the roots, and there's one formula that finds them every time.

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

The discriminant tells you what to expect

The part under the square root, b² − 4ac, is the discriminant, and its sign decides everything before you finish the sum. If it's positive there are two distinct real roots — the parabola crosses the x-axis twice. If it's zero there's one repeated root and the curve just touches the axis at its vertex. If it'snegative there are no real roots; the curve misses the axis entirely and the solutions are a complex conjugate pair, which this calculator still reports.

Worked example

Take x² − 3x + 2 = 0, so a = 1, b = −3, c = 2. The discriminant is (−3)² − 4(1)(2) = 9 − 8 = 1, which is positive, so expect two real roots. Then x = (3 ± √1) / 2, giving x = 2 and x = 1. Check by factoring: (x − 1)(x − 2) = 0 — the same answers, which is why the calculator also shows the factored form when the roots are rational.

The vertex

The turning point of the parabola sits at x = −b / 2a, exactly halfway between the two roots. It's the minimum when a is positive and the maximum when a is negative — useful whenever the quadratic models something you want to optimise, like maximum height or minimum cost.

Floating point and near-cancellation

The roots are exact when the discriminant is a perfect square and approximate otherwise, which is ordinary. The subtler problem is cancellation: when b² is very much larger than 4ac, the standard formula subtracts two nearly equal numbers for one of the roots and loses precision doing it. The result is still close but the last digits are not meaningful. If you need one root of a badly conditioned quadratic to full precision, compute the well-conditioned root first and use the fact that the product of the roots is c/a.