MTH

Quadratic Equation Solver

Enter a, b and c for ax² + bx + c = 0 and get both roots, whether real or complex, plus the discriminant and the vertex of the parabola.

— Enter a, b and c, then solve.

How it's calculated

For ax² + bx + c = 0 the quadratic formula gives x = (−b ± √(b² − 4ac)) ÷ 2a. The part under the root, D = b² − 4ac, is the discriminant:

  • D > 0: two different real roots.
  • D = 0: one repeated real root, x = −b ÷ 2a.
  • D < 0: two complex roots, −b ÷ 2a ± (√(−D) ÷ 2|a|)i.

The vertex of the parabola is at x = −b ÷ 2a, with y found by putting that x back into the equation.

Worked example

Solve x² − 5x + 6 = 0, so a = 1, b = −5, c = 6. The discriminant is (−5)² − 4 × 1 × 6 = 25 − 24 = 1. The roots are (5 ± 1) ÷ 2, which gives x = 3 and x = 2. The vertex is at x = 5 ÷ 2 = 2.5, where y = 6.25 − 12.5 + 6 = −0.25.

For x² + 2x + 5 = 0 the discriminant is 4 − 20 = −16, so the roots are complex: x = −1 ± 2i.

Frequently asked

What if a is zero?

Then the x² term disappears and the equation is linear. The solver tells you so and gives the single root x = −c ÷ b.

What do complex roots mean?

They mean the parabola never touches the x-axis, so no real number solves the equation. The imaginary part i is the square root of −1.

Do I need to rearrange the equation first?

Yes. Move everything to one side so the other side is 0, then read off a, b and c. For example, x² = 3x + 4 becomes x² − 3x − 4 = 0, so a = 1, b = −3, c = −4.

Last updated: October 2026