The Cubic Equation

Everything about $ax^3 + bx^2 + cx + d = 0$ — Cardano's formula, the depressed cubic, the trigonometric method, all four root cases, Vieta's formulas, and every corner case, with live interactive graphs.

1. Standard Form & Key Facts

Every cubic polynomial in one variable can be written in standard form. Unlike quadratics, a cubic always has at least one real root (since complex roots come in conjugate pairs and the degree is odd).

$ax^3 + bx^2 + cx + d = 0 \qquad a \neq 0$
$\text{Discriminant:}\quad \Delta = 18abcd - 4b^3d + b^2c^2 - 4ac^3 - 27a^2d^2$

Always at least one real root

The graph of a cubic goes from $-\infty$ to $+\infty$ (or vice versa), so it must cross the $x$-axis at least once by the Intermediate Value Theorem.

At most three real roots

A degree-3 polynomial can have 1 or 3 real roots. If one root is complex, its conjugate must also be a root, leaving exactly one real root.

2. Interactive Solver

Drag the sliders to change $a$, $b$, $c$, $d$. The cubic, its roots, discriminant, and depressed form all update live.

Δ  ·  case
Equation:
$\Delta$:
Roots:
Depressed form $t^3 + pt + q = 0$:

3. The Four Root Cases

The sign of $\Delta$ determines how many distinct real roots exist. When $\Delta = 0$, a further check is needed to distinguish a double root from a triple root.

$\Delta > 0$ — Three distinct real roots

$x_1, x_2, x_3 \in \mathbb{R}, \quad x_1 \neq x_2 \neq x_3$

The cubic crosses the $x$-axis at three distinct points. Requires the trigonometric (Viète) method; Cardano's formula gives complex intermediates even though all roots are real (casus irreducibilis).

$\Delta = 0$ — Double root + simple root

$x_{1,2} = \sqrt[3]{\tfrac{q}{2}},\quad x_3 = -2\sqrt[3]{\tfrac{q}{2}}$

One root has multiplicity 2 — the curve is tangent to the $x$-axis there. There are still two distinct root values.

$\Delta = 0$, $p = q = 0$ — Triple root

$x_1 = x_2 = x_3 = -\dfrac{b}{3a}$

All three roots coincide. The curve touches but does not cross the $x$-axis. Occurs exactly when the depressed cubic reduces to $t^3 = 0$, i.e.\ $p = q = 0$.

$\Delta < 0$ — One real + two complex roots

$x_1 \in \mathbb{R},\quad x_{2,3} = \alpha \pm \beta i \in \mathbb{C}$

The curve crosses the $x$-axis at exactly one point. Cardano's formula gives the real root directly; complex roots come in conjugate pairs.

4. All Four Cases at a Glance

Each curve below represents one of the four discriminant cases.

5. Reducing to the Depressed Cubic

The substitution $x = t - \dfrac{b}{3a}$ eliminates the $x^2$ term, giving the depressed cubic $t^3 + pt + q = 0$, which is much easier to solve.

$x = t - \dfrac{b}{3a} \;\Longrightarrow\; t^3 + pt + q = 0$
$p = \dfrac{3ac - b^2}{3a^2} \qquad\qquad q = \dfrac{2b^3 - 9abc + 27a^2d}{27a^3}$

The discriminant of the depressed cubic is $\Delta_{\text{dep}} = -4p^3 - 27q^2$. It has the same sign as $\Delta$ (the full cubic discriminant), so both identify the same root case.

6. Cardano's Formula ($\Delta < 0$, one real root)

Published by Gerolamo Cardano in Ars Magna (1545), this is the closed-form solution for the depressed cubic $t^3 + pt + q = 0$ when $\Delta_{\text{dep}} < 0$.

$D = \left(\dfrac{q}{2}\right)^2 + \left(\dfrac{p}{3}\right)^3 \qquad (D > 0 \text{ when } \Delta < 0)$
$t_1 = \sqrt[3]{-\dfrac{q}{2} + \sqrt{D}} + \sqrt[3]{-\dfrac{q}{2} - \sqrt{D}}$
$t_{2,3} = -\dfrac{t_1}{2} \pm \dfrac{\sqrt{3}}{2}\left(\sqrt[3]{-\tfrac{q}{2}+\sqrt{D}} - \sqrt[3]{-\tfrac{q}{2}-\sqrt{D}}\right)i$

The real root is $x_1 = t_1 - b/(3a)$. The complex roots are $x_{2,3} = t_{2,3} - b/(3a)$. Note: $uv = -p/3$ always holds (Vieta's constraint on the substituted values).

7. Trigonometric Method ($\Delta > 0$, three real roots)

When $\Delta > 0$ and $p < 0$, Cardano's formula requires cube roots of complex numbers even though all three roots are real — this is the historic casus irreducibilis. The trigonometric method avoids complex arithmetic entirely.

$m = 2\sqrt{-\dfrac{p}{3}} \qquad \varphi = \dfrac{1}{3}\arccos\!\left(\dfrac{-4q}{m^3}\right)$
$t_k = m\cos\!\left(\varphi - \dfrac{2\pi k}{3}\right) \quad k = 0, 1, 2$

Each of the three values of $k$ gives one distinct real root. Back-substitute: $x_k = t_k - b/(3a)$.

Casus irreducibilis

When $\Delta > 0$ (three real roots), the expression under $\sqrt{\cdot}$ in Cardano's formula is negative, requiring $\sqrt{D_{\text{neg}}} = i\sqrt{|D|}$. Rafael Bombelli (1572) was the first to work through this with complex intermediates and still obtain correct real answers. The trigonometric method, derived later, sidesteps this entirely.

8. Vieta's Formulas for Cubics

If $x_1, x_2, x_3$ are the three roots of $ax^3 + bx^2 + cx + d = 0$, then:

$x_1 + x_2 + x_3 = -\dfrac{b}{a}$
$x_1 x_2 + x_1 x_3 + x_2 x_3 = \dfrac{c}{a}$
$x_1 x_2 x_3 = -\dfrac{d}{a}$

These hold even when roots are complex, and let you reconstruct the cubic from its roots: $a(x - x_1)(x - x_2)(x - x_3) = 0$.

$x_1 + x_2 + x_3 = -b/a$:
$x_1 x_2 + x_1 x_3 + x_2 x_3 = c/a$:
$x_1 x_2 x_3 = -d/a$:

9. Corner Cases & Special Forms

These are the situations where the standard approach requires special handling.

$a = 0$ — Reduces to quadratic

$bx^2 + cx + d = 0$
Apply quadratic formula.

The equation is no longer cubic. The cubic formula is undefined ($a = 0$ means division by zero in the depressed form).

$d = 0$ — Root at zero

$x(ax^2 + bx + c) = 0$
$x_1 = 0$, then solve the quadratic.

$x = 0$ is always a root. Factor it out; the remaining quadratic gives the other two roots.

$b = d = 0$ — Odd-power only

$x(ax^2 + c) = 0$
$x_1{=}0$; $x_{2,3}{=}\pm\sqrt{-c/a}$

If $-c/a > 0$: three real roots. If $-c/a < 0$: one real ($x=0$), two imaginary.

$b = c = 0$ — Pure cubic

$ax^3 + d = 0$
$x = \sqrt[3]{-d/a}$

One real root and two complex cube roots of the same number. The simplest case of Cardano.

$b = c = d = 0$ — Triple root at 0

$ax^3 = 0 \;\Rightarrow\; x = 0$ (×3)

All three roots equal zero. $\Delta = 0$; the graph has an inflection point exactly on the $x$-axis.

Triple root $r$

$a(x-r)^3 = 0$
$b = -3ar,\; c = 3ar^2,\; d = -ar^3$

$\Delta = 0$, $p = 0$, $q = 0$ in depressed form. The curve only touches (inflects on) the $x$-axis.

Double root + simple root

$a(x-r)^2(x-s) = 0$
$\Delta = 0$, two distinct $x$-values.

$\Delta = 0$ but not triple. The curve touches the axis at $r$ and crosses it at $s$.

Casus irreducibilis ($\Delta > 0$)

$D_{\text{card}} < 0$ but all roots real.
Use trig method, not Cardano.

Three real roots exist, yet Cardano's intermediate $\sqrt{D_{\text{card}}}$ is imaginary. The trig method gives real-only arithmetic.

Rational root theorem

$x = \pm\dfrac{\text{factor of }d}{\text{factor of }a}$

For integer coefficients, any rational root must be of this form. Test a few candidates, then factor out the linear term and solve the remaining quadratic.

Depressed cubic $b = 0$

$ax^3 + cx + d = 0$
Already depressed ($p = c/a$, $q = d/a$).

No substitution needed. Apply Cardano or the trig method directly.

Large / poorly scaled coefficients

Normalise: divide by $a$,
then scale $x$ to reduce magnitude.

When coefficients differ by many orders of magnitude, floating-point cancellation can corrupt $\Delta$. Normalise first for numerical stability.

Sum / difference of cubes

$x^3 \pm k^3 = (x \pm k)(x^2 \mp kx + k^2)$

Recognising this pattern gives an immediate factorisation: one real root $x = \mp k$ and a quadratic with complex roots (for the minus form) or real roots (for the plus form).

10. Worked Examples

$\Delta > 0$ — Three rational roots

$x^3 - 6x^2 + 11x - 6 = 0$
Rational root test: try $x=1$: $1-6+11-6=0$ ✓
$(x-1)(x^2-5x+6) = 0$
$(x-1)(x-2)(x-3) = 0$
$x_1=1,\;x_2=2,\;x_3=3$

$\Delta = 4 > 0$. Three distinct real roots found by factoring.

$\Delta > 0$ — Trigonometric method

$x^3 - 3x = 0 \;\Rightarrow\; p=-3,\;q=0$
$m = 2,\;\varphi = \tfrac{1}{3}\arccos(0) = \tfrac{\pi}{6}$
$x_k = 2\cos\!\left(\tfrac{\pi}{6} - \tfrac{2\pi k}{3}\right)$
$x_0=\sqrt{3},\;x_1=0,\;x_2=-\sqrt{3}$

$\Delta = 108 > 0$. Already depressed; trig method applied directly.

$\Delta = 0$ — Double root

$x^3 - 3x - 2 = 0$
$p=-3,\;q=-2$
$\alpha = \sqrt[3]{-2/2} = -1$ (double)
$\beta = -2(-1) = 2$ (simple)
$x_{1,2}=-1,\;x_3=2$

$\Delta = 0$. Verify: $(x+1)^2(x-2) = x^3-3x-2$ ✓

$\Delta = 0$ — Triple root

$x^3 - 3x^2 + 3x - 1 = 0$
$= (x-1)^3 = 0$
$x_1 = x_2 = x_3 = 1$
$p = 0,\;q = 0$

Both the depressed coefficients are zero. Inflection point on the axis.

$\Delta < 0$ — Cardano (one real root)

$x^3 + x + 1 = 0 \;\Rightarrow\; p=1,\;q=1$
$D = \tfrac{1}{4}+\tfrac{1}{27} = \tfrac{31}{108}$
$x_1 = \sqrt[3]{-\tfrac{1}{2}+\sqrt{\tfrac{31}{108}}} + \sqrt[3]{-\tfrac{1}{2}-\sqrt{\tfrac{31}{108}}}$
$x_1 \approx -0.6824$

$\Delta = -4-27 = -31 < 0$. Two complex conjugate roots also exist.

$d = 0$ — Root at zero

$2x^3 - 8x^2 + 6x = 0$
$2x(x^2 - 4x + 3) = 0$
$2x(x-1)(x-3) = 0$
$x_1=0,\;x_2=1,\;x_3=3$

$x=0$ is always a root when $d=0$. Factor it out immediately.