How this calculator works
- Step 1Depressx = t − b/3aRemove the x² term.
- Step 2DiscriminantΔThree real roots, a repeat, or one real.
- Step 3Solvecosine or CardanoThen polish with Newton’s method.
Every cubic has three roots, counting repeats. With real coefficients, either all three are real or one is real and two form a complex conjugate pair.
The calculator shifts the cubic to remove the x² term, then uses the trigonometric form when all roots are real and Cardano’s formula otherwise.
Worked example: x³ − 6x² + 11x − 6 = 0
- Check
(x − 1)(x − 2)(x − 3) = x³ − 6x² + 11x − 6
- Shiftx = t + 2t³ − t = 0
- t−1, 0, 1
- Roots1, 2, 3
Read the result
- x³ − 8 = 0−1 − 1.732051i, −1 + 1.732051i, 2One real root and a complex pair.
- (x − 1)³ = 01, 1, 1One root repeated three times.
x³ − 15x − 4 = 0 has three real roots, −3.732051, −0.267949, 4, even though Cardano’s formula passes through complex numbers to find them.
Assumptions and limits
- Real coefficientsa, b, c and d are real numbers.
- Six decimalsRoots are rounded for display.
- a ≠ 0Otherwise it is a quadratic.
- Repeated rootsShown once for each time they occur.
Related equation tools
With real coefficients, a cubic always has at least one real root. Lower degrees and systems have their own tools.
For second-degree equations, use the quadratic formula calculator. Several linear equations at once are solved by the system of equations calculator, and the complex number calculator handles complex roots.
Common mistakes
Mistake: Entering an equation that is not set to 0.
Instead: Move all terms to one side first.
Mistake: Leaving out a missing term.
Instead: Enter 0 for b or c when the term is absent.
Checking the method
A separate script finds a real root by bisection on sign changes and the other two from the remaining quadratic, without any cubic formula.
Read how we test our calculators, or browse more maths calculators.