Quadratic Equation Calculator
Solve ax² + bx + c = 0 for its roots.
Calculator Inputs
Your Result
Enter your details and press Calculate to see your result.
Formula
How it works
- Enter the coefficients a, b, and c for ax² + bx + c = 0.
- View the discriminant and the roots of the equation.
Share on Social Media:
This calculator solves quadratic equations of the form ax² + bx + c = 0. Enter the coefficients a, b and c and it returns the discriminant and the roots (the values of x that make the equation true), whether they are two real numbers, one repeated number, or a pair of complex numbers.
The quadratic formula
x = (−b ± √(b² − 4ac)) ÷ 2a
The part under the square root, D = b² − 4ac, is the discriminant. It tells you what kind of roots to expect:
| Discriminant | Roots | Graph of y = ax² + bx + c |
|---|---|---|
| D > 0 | Two different real roots | Crosses the x-axis twice |
| D = 0 | One repeated real root | Touches the x-axis once |
| D < 0 | Two complex roots (p ± qi) | Doesn't reach the x-axis |
Worked examples
- x² − 5x + 6 = 0 (a = 1, b = −5, c = 6): D = 25 − 24 = 1. x = (5 ± 1) ÷ 2, so x = 3 or x = 2.
- x² − 4x + 4 = 0: D = 16 − 16 = 0. One repeated root, x = 2.
- x² + 2x + 5 = 0: D = 4 − 20 = −16. x = (−2 ± 4i) ÷ 2, so x = −1 ± 2i.
Checking your answer
Substitute the root back in: for x = 3, 9 − 15 + 6 = 0. ✓ Another quick check uses Vieta's formulas: the roots add up to −b/a and multiply to c/a. For the first example, 3 + 2 = 5 and 3 × 2 = 6. ✓
Other ways to solve
- Factoring: x² − 5x + 6 = (x − 2)(x − 3). Quick when the roots are whole numbers.
- Completing the square: rewrite as (x + p)² = q. The quadratic formula comes from doing this in general.
Notes
a can't be 0; that would make it a linear equation, bx + c = 0, with the single solution x = −c/b. Roots are rounded to 4 decimal places. If your equation isn't in standard form, move every term to one side first: 2x² = 3x + 5 becomes 2x² − 3x − 5 = 0.
Related: Root Calculator, Slope Calculator.