Maths

Cubic Equation Calculator

Solve ax³ + bx² + cx + d = 0 for all three roots, real or complex, with the discriminant.

By Nitin Raturi · Last reviewed

Your worksheet

How to use the Cubic Equation Calculator

Solve ax³ + bx² + cx + d = 0, including complex roots.

  1. Rearrange your equation so one side is 0.
  2. Enter a, b, c and d.
  3. Read the three roots and what kind they are.

Good to know

  • Every cubic with real coefficients has at least one real root.

Solve ax³ + bx² + cx + d = 0. Enter 0 for any missing term.

a (x³ coefficient)

The number in front of x³.

How to fill it in

  • Enter any number except 0.

b (x² coefficient)

The number in front of x².

How to fill it in

  • Enter 0 if there is no x² term.

Example

x³ − 6x² + 11x − 6 = 0 has roots 1, 2, 3.

c (x coefficient)

The number in front of x.

How to fill it in

  • Enter 0 if there is no x term.

Example

x³ − 15x − 4 = 0 has roots −3.732051, −0.267949, 4.

d (constant)

The number with no x.

How to fill it in

  • Move every term to one side so the equation equals 0 first.

Example

x³ − 8 = 0 has roots −1 − 1.732051i, −1 + 1.732051i, 2; (x − 1)³ = 0 has 1, 1, 1.

Roots of x³ − 6x² + 11x − 6 = 0

1, 2, 3

x³ − 6x² + 11x − 6 = 0 has three real roots: 1, 2, 3.

x₁
1
x₂
2
x₃
3
Discriminant
4

Real coefficients. Roots are shown to six decimal places; repeated roots are listed once for each time they occur.

How this calculator works

  1. Step 1Depressx = t − b/3aRemove the x² term.
  2. Step 2DiscriminantΔThree real roots, a repeat, or one real.
  3. 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

A cubic with three whole-number roots
Check
(x − 1)(x − 2)(x − 3) = x³ − 6x² + 11x − 6
  1. Shiftx = t + 2t³ − t = 0
  2. t−1, 0, 1
  3. 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.

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.

Frequently asked questions

What are the roots of x³ − 6x² + 11x − 6 = 0?

1, 2, 3, because it factors as (x − 1)(x − 2)(x − 3).

What are the roots of x³ − 8 = 0?

−1 − 1.732051i, −1 + 1.732051i, 2: one real root and a complex pair.

Can a cubic have a repeated root?

Yes. (x − 1)³ = 0 has the root 1 three times: 1, 1, 1.

Does every cubic have a real root?

Yes, when its coefficients are real, because the curve must cross the x-axis.

What are the roots of x³ − 15x − 4 = 0?

−3.732051, −0.267949, 4, all real.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 4 Nov 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release.