How this calculation works
The discriminant tells you whether a quadratic has two distinct real roots, a repeated real root or a complex conjugate pair. The worked calculation follows those cases explicitly, handles linear and constant equations when the leading terms vanish, and checks each computed root in the original polynomial.
Worked example
This example uses illustrative inputs. Your current result is shown above.
For x² − 5x + 6 = 0, D = 25 − 24 = 1. The formula gives (5 ± 1)/2, so the roots are 2 and 3. Substitution gives 4 − 10 + 6 = 0 and 9 − 15 + 6 = 0. For x² + 1 = 0, D = −4 and the roots are i and −i.
Assumptions and limits
- Enter finite real coefficients for an equation whose right-hand side is zero. Move all terms to the left before entering coefficients.
- A zero leading coefficient produces a linear or constant equation; it is not silently changed to a nonzero value.
- Input fields use JavaScript numbers, normally preserving about 15–17 significant decimal digits. Calculation uses 80 significant digits; displayed roots use up to 12. Extreme results use scientific notation.
- Near a repeated root, small changes or rounding in the original coefficients can change the discriminant and roots.
Questions people ask
What does a negative discriminant mean?
There are no real roots, but there are two complex conjugate roots. For x² + 1 = 0, the discriminant is −4 and the roots are i and −i, where i² = −1.
What if coefficient a is zero?
The equation becomes bx + c = 0. If b is nonzero, the root is −c/b. If both a and b are zero, c = 0 has every number as a solution, while a nonzero constant has no solution.
Why does the working use q instead of subtracting the square root twice?
When one root is tiny and the other is large, subtracting almost equal values can erase the smaller root numerically. The equivalent q/a and c/q formulas preserve it more reliably. Both results satisfy the same quadratic formula.
Are displayed roots exact?
Integer and terminating decimal results may be exact; irrational roots are decimal approximations. Working retains 80 significant digits and display uses up to 12, with scientific notation for extreme values. Input fields themselves retain about 15–17 significant digits.