Tokealo
Education

Quadratic Equation Solver

Solve ax² + bx + c = 0 for real or complex roots, with the discriminant and the formula shown.

x² +
x +
= 0

Enter values for a, b, and c to solve the equation.

How to use the quadratic solver

A quadratic equation has the form ax² + bx + c = 0. Type the three coefficients into the boxes that match each term, and the roots appear straight away alongside the discriminant and the formula worked out with your values.

The coefficient a must not be zero, since that would leave a plain linear equation with no x² term to solve. The values of b and c are free to be anything, including zero or negatives, so an equation like x² − 9 = 0 works by simply leaving b at zero.

The quadratic formula

Every quadratic yields to one formula, which gives both roots in a single expression:

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

The plus and minus sign is what produces two answers. Take x² − 5x + 6 = 0: plugging in a = 1, b = −5, c = 6 gives (5 ± √1) ÷ 2, which splits into x = 3 and x = 2. Those are the points where the parabola crosses the x-axis.

What the discriminant tells you

The piece under the square root, b² − 4ac, is called the discriminant, and its sign reveals the nature of the roots before you finish the arithmetic.

  • Positive means two distinct real roots, so the parabola crosses the x-axis at two separate points.
  • Zero means one repeated real root, where the parabola just touches the axis at its vertex.
  • Negative means two complex roots, written as a pair of conjugates p ± qi, and the parabola never meets the axis.

A worked example with complex roots

Not every quadratic has real solutions. Consider x² + 2x + 5 = 0. Here a = 1, b = 2, and c = 5, so the discriminant is 2² − 4·1·5, which comes to −16. A negative discriminant signals complex roots.

Taking the square root of −16 introduces the imaginary unit i, where i² = −1, giving 4i. The formula then yields (−2 ± 4i) ÷ 2, which simplifies to −1 + 2i and −1 − 2i. These conjugate roots are exactly what the solver returns for this equation.

Frequently asked questions

What is the quadratic formula?
It is x = (−b ± √(b² − 4ac)) ÷ 2a, the expression that solves any equation of the form ax² + bx + c = 0. The plus-or-minus sign gives the two roots in one step.
What does the discriminant tell me?
The discriminant b² − 4ac shows the type of roots without solving fully. Positive gives two real roots, zero gives one repeated root, and negative gives two complex roots.
Why can't a be zero?
If a is zero there is no x² term, so the equation is linear rather than quadratic and the formula's division by 2a breaks down. The solver asks for a non-zero a and notes that the equation would be linear.
What are complex roots?
When the discriminant is negative, the roots involve the imaginary unit i, where i² equals −1. They appear as a conjugate pair p + qi and p − qi, and the parabola never crosses the x-axis.
Can I solve an equation with no b or c term?
Yes. Leave the missing coefficient at zero. For x² − 4 = 0, set a = 1, b = 0, and c = −4, and the solver returns x = 2 and x = −2.

Related tools