Cubic equation solver
x³ − 6x² + 11x − 6 = 0 has the roots 1, 2 and 3. The discriminant said so before they were found: positive means three distinct real roots, zero means a repeated one, negative means one real and two complex. That sign is printed with the answer, because it is what tells you whether to expect the roots you got.
Enter the four coefficients of ax³ + bx² + cx + d and get all three roots, complex ones included, with the discriminant that predicted how many would be real.
The case worth naming is three distinct real roots. Cardano’s formula reaches those only through the square root of a negative number, so a solver written to stay in the reals fails exactly where there is most to report. This branches on the discriminant and uses the trigonometric form there, which is why x³ − 6x² + 11x − 6 comes back as 1, 2 and 3.
Roots checked back into the equation on every test case · How we check
Discriminant is positive: three distinct real roots.
- x₁3
- x₂2
- x₃1
- Depressed cubic
- t³ + -1t + 0
- Discriminant
- 4
- Roots sum to
- 6
- Roots multiply to
- 6
The cases, one of each
| Equation | Roots | Discriminant |
|---|---|---|
| x³ − 6x² + 11x − 6 | 3, 2, 1 | 4 — three distinct real roots |
| x³ − 3x + 2 | -2, 1, 1 | 0 — a repeated root |
| x³ − 6x² + 12x − 8 | 2, 2, 2 | 0 — a triple root |
| x³ + x + 1 | -0.6823, 0.3412 + 1.1615i, 0.3412 − 1.1615i | -31 — one real, two complex |
| x³ − 2 | 1.2599, -0.63 + 1.0911i, -0.63 − 1.0911i | -108 — the cube root of two |
The last row is the one that shows the method: x³ − 2 has one real root, the cube root of two, and two complex ones spaced 120° around it on the complex plane. Every cubic’s three roots sit at the corners of a triangle in that plane, which is what the trigonometric solution is doing geometrically.
Questions people actually ask
- How do you solve a cubic equation?
- Try to factor first: guess a rational root from the factors of d over the factors of a, divide it out, and solve the quadratic that remains. When nothing factors, substitute x = t − b/3a to remove the squared term and apply Cardano's formula to the result.
- How many roots does a cubic have?
- Exactly three, counted with multiplicity, by the fundamental theorem of algebra. With real coefficients either all three are real, or one is real and the other two are a complex conjugate pair — complex roots always come in pairs, so a cubic can never have exactly two real roots.
- What does the discriminant tell you?
- How many roots are real. Δ = −4p³ − 27q² on the depressed cubic: positive means three distinct real roots, zero means a repeated root, negative means one real root and a conjugate pair. It answers the question without finding the roots.
- What is the rational root theorem?
- Any rational root is a factor of the constant term divided by a factor of the leading coefficient. For x³ − 6x² + 11x − 6 the candidates are ±1, ±2, ±3, ±6, and testing 1 gives zero straight away. It is the fastest route by hand and it finds nothing when the roots are irrational.
- Why does Cardano's formula produce imaginary numbers for real answers?
- This is the casus irreducibilis, and it is why complex numbers were invented rather than discovered. When all three roots are real, the formula passes through the square root of a negative quantity to reach them, and the imaginary parts cancel at the end. Bombelli worked this out in 1572, thirty years after Cardano published the formula he could not fully explain.
- What are Vieta's formulas?
- For ax³ + bx² + cx + d, the roots sum to −b/a, sum in pairs to c/a, and multiply to −d/a. They check an answer without re-solving: three roots of 1, 2 and 3 must sum to 6 and multiply to 6, and x³ − 6x² + 11x − 6 says exactly that.
- Is there a formula for higher degrees?
- For the quartic, yes — Ferrari found it in 1540. For the quintic and beyond, no: the Abel–Ruffini theorem proves no general solution in radicals exists. Degree four is where the algebra stops and numerical methods take over.
Cite this page
- APA
- Rule Calculator. (2026). Cubic Equation Solver. Rule Calculator. https://rulecalculators.com/cubic-equation
- MLA
- "Cubic Equation Solver." Rule Calculator, August 16, 2026, https://rulecalculators.com/cubic-equation.
- Chicago
- Rule Calculator. "Cubic Equation Solver." Rule Calculator. Last reviewed August 16, 2026. https://rulecalculators.com/cubic-equation.
The date is when the figures on this page were last checked against their source, not the day you opened it. Add your own access date if your style needs one.