This quadratic equation calculator solves equations written as ax² + bx + c = 0. It handles two real roots, a repeated root, complex roots, linear equations when a is zero, and degenerate special cases.
How to use this calculator
Enter coefficients a, b, and c. The discriminant determines the nature of the roots. If a is zero, the calculator solves bx + c = 0 as a linear equation instead of forcing a quadratic formula division by zero.
Formula & calculation method
Δ = b² − 4ac; x = (−b ± √Δ) / (2a)A positive discriminant produces two real roots, zero produces one repeated real root, and a negative discriminant produces a conjugate pair of complex roots. When both a and b are zero, the equation is either always true or has no solution depending on c.
Worked example
For x² − 3x + 2 = 0, the discriminant is 1 and the roots are 1 and 2. For x² + 1 = 0, the discriminant is negative and the roots are i and −i.
Why this is useful
The calculator distinguishes equation types and special cases rather than returning NaN. Showing the discriminant and root forms supports learning, verification, and quick checks of algebraic work.
Limitations to keep in mind
Floating-point rounding can affect values very close to a repeated-root threshold. The tool provides numerical roots, not symbolic factoring, and extremely large coefficients may exceed safe floating-point range.
Frequently asked questions
What happens when a is zero?
The equation becomes linear. If b is nonzero, the single root is −c/b; otherwise it is an identity or contradiction.
Are complex roots supported?
Yes. Negative discriminants produce roots expressed with i, where i² = −1.
What does a zero discriminant mean?
The quadratic has one repeated real root, so the plus and minus branches of the formula coincide.