Find polynomial roots exactly
Enter the coefficients of a quadratic (ax² + bx + c) or cubic (ax³ + bx² + cx + d) equation and this tool returns all roots, including complex ones shown in a + bi form. It is built for algebra coursework, engineering and anyone who needs exact roots rather than a graph.
How it works
For a quadratic, it uses the quadratic formula and the discriminant to decide the type of roots:
disc = b² − 4ac
x = (−b ± √disc) / 2a (disc < 0 gives a complex conjugate pair)
For a cubic, it reduces to a depressed cubic and applies Cardano’s method, switching to the trigonometric form when the discriminant indicates three real roots. The leading coefficient a must be non-zero so the degree is correct.
Example
The quadratic x² − 3x + 2 = 0 (a=1, b=−3, c=2):
- disc = (−3)² − 4·1·2 = 9 − 8 = 1 (positive → two real roots)
- x = (3 ± 1) / 2 → x = 2 and x = 1
The quadratic x² + 1 = 0 (a=1, b=0, c=1):
- disc = −4 (negative) → roots x = +i and x = −i
| Equation | Discriminant | Roots |
|---|---|---|
| x² − 3x + 2 | 1 | 2, 1 |
| x² − 2x + 1 | 0 | 1 (repeated) |
| x² + 1 | −4 | i, −i |
Every calculation runs locally in your browser.