Cubic Equation Solver
Find all three roots of ax³+bx²+cx+d=0 using the depressed-cubic method, including complex roots.
About Cubic Equation Solver
This solver uses the depressed-cubic (Cardano/trigonometric) method. The equation ax³+bx²+cx+d=0 is first reduced to t³+pt+q=0 by substituting x = t − b/(3a). Then the discriminant Δ = −4p³ − 27q² determines the root structure: Δ > 0 gives three distinct real roots (trigonometric solution), Δ = 0 gives a repeated root, and Δ < 0 gives one real and two complex conjugate roots (Cardano's formula).
Formulas
Depressed cubic substitution
x = t − b/(3a)
- t
- New variable
- b
- x² coefficient
- a
- x³ coefficient
Reduced coefficients
p = (3ac − b²)/(3a²), q = (2b³ − 9abc + 27a²d)/(27a³)
- p
- Linear coefficient of depressed cubic
- q
- Constant of depressed cubic
Worked example
With the default values below, Cubic Equation Solver returns Root 1 of 3. Change any input above and every figure here is recalculated in your browser.
Inputs used
- a (x³ coefficient)
- 1
- b (x² coefficient)
- -6
- c (x coefficient)
- 11
- d (constant)
- -6
Results
- Root 1
- 3
- Root 2
- 1
- Root 3
- 2
- Discriminant
- 4.000000
Step by step
- 1Values used
- 2Depressed cubic substitution
- 3Reduced coefficients
- 4Root 1= 3
- 5Root 2= 1
- 6Root 3= 2
- 7Discriminant= 4.000000
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is the depressed cubic method?
It removes the x² term via a linear substitution x = t − b/(3a), reducing the equation to t³ + pt + q = 0, which can be solved by Cardano's formula or the trigonometric method.
When are the roots complex?
When the inner discriminant q²/4 + p³/27 > 0, there is one real root and a pair of complex conjugate roots.
