Cubic Equation Calculator

Solve ax^3 + bx^2 + cx + d = 0, see all three roots, and understand whether the cubic has three real roots, a repeated root, or a complex-conjugate pair.

equation
Examples

Three distinct real roots: 1, 2, and 3.

Root pattern
Three distinct real roots
Root x1
1
Root x2
2
Root x3
3
Discriminant Δ
4

Three real roots were found. The solver uses the discriminant branch and checks the reported values by substitution before showing them.

Was this useful?

Examples

How It Works

Formula

ax3+bx2+cx+d=0,a0ax^3 + bx^2 + cx + d = 0,\quad a \ne 0

x=tb3ax = t - \frac{b}{3a}

Δ=18abcd4b3d+b2c24ac327a2d2\Delta = 18abcd - 4b^3d + b^2c^2 - 4ac^3 - 27a^2d^2

Variables

aa

Coefficient of x^3 (must be non-zero)

bb

Coefficient of x^2

cc

Coefficient of x

dd

Constant term

xx

Unknown root value

Start with the canonical cubic ax3+bx2+cx+d=0ax^3 + bx^2 + cx + d = 0 with a0a \ne 0. The solver normalizes by dividing through by aa, then shifts the variable so the x2x^2 term disappears. From there the discriminant tells which branch to use: three real roots, a repeated real root, or one real root with a complex-conjugate pair.

This is a focused numeric cubic solver, not a full symbolic algebra system. When a root is not simple enough to present cleanly, the calculator labels it with \approx and checks the reported roots by substitution before showing them.

Frequently Asked Questions

01What does the cubic discriminant tell me?
The discriminant classifies the roots. A positive discriminant means three distinct real roots, zero means at least one repeated real root, and a negative discriminant means one real root plus a complex-conjugate pair.
02Why does the calculator show approximate roots sometimes?
Many cubic roots are not simple fractions or integers. In those cases the calculator shows a numerical approximation and verifies the reported roots by substitution instead of pretending every answer has a neat symbolic form.
03What happens when a = 0?
Then the equation is no longer cubic. This calculator stops and tells you directly instead of leaving an old cubic answer on screen.
04How are repeated roots handled?
Near-equal roots are grouped when the discriminant is effectively zero, so floating-point noise does not invent fake distinctions between values that should repeat.

All calculators