Student calculator
Quadratic Formula Calculator
Enter a, b, and c for ax² + bx + c = 0. The calculator shows the discriminant and the roots, including complex roots when the discriminant is negative.
Quadratic
Solve ax² + bx + c = 0
Result
Real roots
3 and 2
Discriminant
1
The discriminant is a perfect square, so these roots are exact. The filled-in equation is an example.
How it works
The discriminant is b² − 4ac. A positive discriminant gives two real roots, zero gives one repeated real root, and a negative discriminant gives two complex roots. Those complex roots are conjugates: they share a real part and have opposite imaginary parts.
When the discriminant is a perfect square, the roots are exact fractions from the coefficients you enter. Otherwise the page keeps the exact expression and, when the numbers fit, a rounded decimal. The example x² − 5x + 6 = 0 is filled in so you can see roots 3 and 2. Replace a, b, and c with your equation.
a cannot be zero, because the formula divides by 2a and the equation would be linear. Invalid text is rejected rather than treated as zero.
Formulas
The quadratic formula uses the discriminant under the square root.
- x = (−b ± square root of (b² − 4ac)) / (2a)
- D = b² − 4ac
- a ≠ 0
Worked examples
Example: x² − 5x + 6 = 0
a = 1, b = −5, and c = 6 give D = 25 − 24 = 1. The roots are (5 ± 1) / 2, which are 3 and 2.
Example: x² + 1 = 0
a = 1, b = 0, and c = 1 give D = −4. The roots are i and −i. A negative discriminant is not an error; it means the roots are not real.
FAQ
What if a is zero?
The equation is not quadratic, and the formula would divide by zero. The calculator rejects a = 0.
What does a negative discriminant mean?
There are no real roots. The roots are complex conjugates. When the absolute value of the discriminant is a perfect square, the page shows the exact real and imaginary parts. Otherwise it shows the exact form and a rounded decimal.
Are the roots always whole numbers?
No. Whole numbers show up when the discriminant is a perfect square and it divides evenly, as in x² − 5x + 6 = 0. Other equations keep a square root in the exact form.
Which equations does this solve?
It solves ax² + bx + c = 0 from the three coefficients you enter. It does not solve higher-degree polynomials or systems of equations.