Quadratic Equation Solver

How do I solve a quadratic equation?

How it is calculated

The tool solves ax² + bx + c = 0 with the quadratic formula x = (-b ± √D) / (2a), where D = b² - 4ac is the discriminant. If D > 0 there are two different real roots. If D = 0 there is one repeated root, shown twice as x1 and x2. If D < 0 there are no real roots and the tool shows a complex pair, real part ± imaginary part × i, where the imaginary part √(-D) / (2|a|) is always shown as a positive number, even when a is negative. The coefficient a must not be 0, since the equation would then be linear and the tool returns nothing. The discriminant is displayed as well, and numbers are rounded to two decimals.

Worked example

Solve x² - 5x + 6 = 0, so a = 1, b = -5, c = 6. Discriminant D = (-5)² - 4·1·6 = 25 - 24 = 1.00. √D = 1. Then x1 = (5 + 1) / 2 = 3.00 and x2 = (5 - 1) / 2 = 2.00. Both roots can be checked by substitution: 3² - 15 + 6 = 0 and 2² - 10 + 6 = 0. If instead c were 10, D would be -15 and the roots would be complex.

Try this example →

Common mistakes

  • Forgetting that the equation must equal zero. Move every term to the left side first, then read off a, b and c.
  • Dropping the sign of b: with b = -5 the formula uses -b = +5.
  • Entering 0 for a, which is not a quadratic.
  • Assuming a negative discriminant means the answer is wrong. It means the parabola does not cross the x-axis and the roots are complex.

About this calculator

This solver finds the roots of a quadratic equation ax² + bx + c = 0 from its coefficients, using the quadratic formula, and reports the discriminant (b² − 4ac) along the way since its sign determines what kind of roots exist: positive means two distinct real roots, zero means one repeated real root, and negative means two complex roots involving the imaginary unit i, which the calculator returns rather than treating as "no solution."

Students use it to check algebra homework and to see the roots of equations that don't factor neatly by inspection, while it also comes up in physics and engineering problems that reduce to a quadratic — projectile motion, optimizing area or profit, and circuit analysis all regularly produce an ax² + bx + c = 0 that needs solving quickly and correctly, including in the complex-root case that's easy to get wrong by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Look at the discriminant before the roots. A positive value means two real solutions, zero means one repeated solution, and a negative value means the parabola never touches the x-axis, so the roots are complex. In a physics problem such as a thrown ball, a negative discriminant tells you it never reaches the height you asked about. Roots are rounded to two decimals, so substituting back may leave a tiny remainder. Post your equation if a result looks surprising.

Popular calculators

All Calculators