How to use it
- Type a, b, c and d in ax³ + bx² + cx + d = 0. Decimals are fine; a must not be 0.
- The roots appear as you type. A complex pair is written a ± bi. A repeated root is marked as a double or triple root.
- When some root is a fraction, the cubic is also written in factorised form.
- The working shows the substitution, the discriminant and the formula that applies.
- The address bar holds the four coefficients, so a link brings the same equation back.
The method
- Divide by a so that the x³ coefficient is 1.
- Remove the x² term. Substituting x = t − b/3 turns the cubic into the depressed cubic t³ + pt + q = 0, with p = c − b²/3 and q = 2b³/27 − bc/3 + d.
- Read the discriminant. Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². If Δ > 0 there are three different real roots, if Δ < 0 one real root and a complex pair, and if Δ = 0 a repeated root.
- Apply the formula. With one real root, Cardano’s formula gives t = u + v, where u = ∛(−q/2 + √D), v = −p/(3u) and D = q²/4 + p³/27. With three real roots the same formula would pass through complex numbers, so the trigonometric form is used instead: t_k = 2√(−p/3) · cos(⅓ arccos((3q/2p)√(−3/p)) − 2πk/3).
- Undo the substitution: x = t − b/3.
Example: x³ − 6x² + 11x − 6
Substituting x = t + 2 gives t³ − t = 0, so p = −1 and q = 0. The discriminant is 4, positive, so there are three real roots: t = −1, 0 and 1. Back in x they are 1, 2 and 3, and the cubic factorises as (x − 1)(x − 2)(x − 3).
Example: x³ + x + 1
Here Δ = −31 < 0: one real root, x ≈ −0.6823, and a complex pair, about 0.3412 ± 1.1615i. The root is irrational, so there is no factorised form with whole numbers.
Not covered
Equations of degree four and higher are not solved here, and neither is partial fraction decomposition. A quadratic is solved by the equation solver; dividing one polynomial by another is the polynomial division calculator.