Quadratic Equation Solver

Solve ax² + bx + c = 0: real or complex roots via the quadratic formula, plus the discriminant and vertex, with each step of the working shown.

Solve ax² + bx + c = 0

The quadratic formula

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

Any equation of the form ax² + bx + c = 0 (with a ≠ 0) is solved by this formula. The expression under the square root, D = b² − 4ac, is the discriminant, and it tells the whole story before you finish the arithmetic: two real roots if D > 0, one repeated root if D = 0, and a complex conjugate pair if D < 0.

Worked example: x² − 3x − 4 = 0

Here a = 1, b = −3, c = −4. The discriminant is D = (−3)² − 4 × 1 × (−4) = 9 + 16 = 25. Since 25 > 0 there are two real roots: x = (3 ± √25) ÷ 2 = (3 ± 5) ÷ 2, giving x = 4 and x = −1. Because √25 = 5 is a whole number the quadratic also factors neatly: x² − 3x − 4 = (x − 4)(x + 1).

The vertex

vertex x = −b ÷ 2a, vertex y = f(−b ÷ 2a)

The parabola turns at its vertex, always exactly midway between the roots. For the example, x = 3 ÷ 2 = 1.5 and y = 1.5² − 3 × 1.5 − 4 = −6.25. Since a > 0 the parabola opens upward and the vertex is its minimum.

Complex roots

If D < 0 the graph never touches the x-axis, and the roots come as a conjugate pair −b/2a ± (√−D / 2a)i. The solver writes these out in a ± bi form — no real solutions, but complete complex ones.

When a = 0

Dropping the x² term makes the equation linear, bx + c = 0, with the single solution x = −c ÷ b. Enter a = 0 and the solver will point this out and give you that answer directly.

Frequently asked questions

What is the quadratic formula?
For ax² + bx + c = 0, the roots are x = (−b ± √(b² − 4ac)) ÷ 2a. It always works — unlike factoring, which only works when the roots happen to be tidy.
What does the discriminant tell me?
D = b² − 4ac decides the kind of roots before you solve: D > 0 gives two different real roots, D = 0 gives one repeated real root, and D < 0 gives a pair of complex conjugate roots a ± bi.
What are complex roots?
When D < 0 the parabola never crosses the x-axis, so there are no real solutions. The formula still gives answers using i = √(−1): a conjugate pair like 1.5 ± 2.5i. They are perfectly valid solutions in the complex numbers.
What is the vertex of a parabola?
The turning point — the minimum if a > 0, the maximum if a < 0. Its x-coordinate is −b ÷ 2a, exactly halfway between the roots, and its y-coordinate is the function evaluated there.
Why can’t a be zero?
With a = 0 the x² term vanishes and the equation is linear: bx + c = 0, solved by x = −c ÷ b. The solver detects this and gives you that answer instead of dividing by zero.
When can a quadratic be factored?
Over the integers, exactly when the discriminant is a perfect square (with integer coefficients). x² − 3x − 4 has D = 25 = 5², so it factors as (x − 4)(x + 1).