Quadratic Equation Solver
Enter the coefficients a, b and c of ax² + bx + c = 0. The solver shows both roots, the discriminant and the vertex of the parabola, with the working.
Solve ax² + bx + c = 0
The quadratic formula
x = (−b ± √(b² − 4ac)) ÷ 2a
- a, b, c
- the coefficients of ax² + bx + c = 0 (a ≠ 0)
- b² − 4ac
- the discriminant, D
- ±
- gives the two solutions: one with +, one with −
What the discriminant tells you
| Discriminant | Solutions | Graph |
|---|---|---|
| D > 0 | Two different real roots | Crosses the x-axis twice |
| D = 0 | One repeated real root | Touches the x-axis at the vertex |
| D < 0 | Two complex roots (no real solutions) | Never meets the x-axis |
Worked example
Solve 2x² − 3x − 2 = 0
- a = 2, b = −3, c = −2
- D = (−3)² − 4 × 2 × (−2) = 9 + 16 = 25
- √D = 5
- x = (3 ± 5) ÷ 4
- x = 8 ÷ 4 = 2, or x = −2 ÷ 4 = −0.5
x = −0.5 or x = 2. Check: 2(2)² − 3(2) − 2 = 8 − 6 − 2 = 0.
Other ways to solve
- Factoring — fastest when the roots are whole numbers or simple fractions: 2x² − 3x − 2 = (2x + 1)(x − 2).
- Completing the square — rewrites the equation as a(x − h)² + k = 0; it is how the quadratic formula is derived, and it gives the vertex (h, k) directly.
- Graphing — the roots are where the parabola y = ax² + bx + c crosses the x-axis.
How this solver avoids rounding errors
When b² is much larger than 4ac, the textbook formula subtracts two nearly equal numbers and loses accuracy in the smaller root. This solver uses the equivalent stable form: it computes q = −(b ± √D) ÷ 2 with the sign that avoids cancellation, then x₁ = q ÷ a and x₂ = c ÷ q. For x² + 100,000,000x + 1 = 0 it returns the small root −0.00000001 correctly, where the naive formula is off by about 25%.
Common questions
Why does the solver show “i”?
When the discriminant is negative there is no real number whose square is negative, so the solutions are complex numbers written with i = √−1. They matter in engineering and physics; if you only need real solutions, the answer is “no real solution”.
What is the vertex?
The turning point of the parabola y = ax² + bx + c, at x = −b ÷ 2a. It is the minimum value when a is positive and the maximum when a is negative.