Cubic Equation Solver

Enter a, b, c and d from ax³ + bx² + cx + d = 0. You get the real and complex roots and the discriminant, with exact answers where the roots are whole numbers or fractions.

If a term is missing, enter 0 for it. The number a cannot be zero.

Worked examples

Three whole-number roots

x³ - 6x² + 11x - 6 = 0

x = 1, 2 and 3

Factorises as (x - 1)(x - 2)(x - 3).

One real root

x³ - 1 = 0

x = 1, and -0.5 ± 0.866i

The complex roots are the other cube roots of 1.

About Cubic Equation Solver

A cubic equation has x³ as its highest power, and it always has three roots once complex numbers are counted. Either all three roots are real, or there is one real root and a pair of complex ones that mirror each other. The discriminant tells you which: positive means three different real roots, zero means a repeated root, and negative means one real root with two complex roots. A cubic curve always crosses the x axis at least once.

The solver first looks for a root that is a whole number or a fraction, using the rational root theorem, which says such a root must be a factor of d divided by a factor of a. If it finds one, it divides it out and solves the remaining quadratic exactly. For x³ - 6x² + 11x - 6 = 0 that gives 1, 2 and 3. When there is no simple root, it uses the closed formulas for a cubic and refines the answer, so the decimals are accurate to many places. The discriminant is calculated exactly so the classification is always right.

How to use Cubic Equation Solver

  1. Write your equation as ax³ + bx² + cx + d = 0.
  2. Enter a, b, c and d, using 0 for any missing term. The number a cannot be 0.
  3. Read the real roots and any complex pair.
  4. Look at the table for the discriminant and any exact root that was found.

Common uses

  • Solving cubic equations in A level and university maths
  • Finding the dimensions of a box from a volume equation
  • Engineering formulas that lead to a cubic
  • Checking roots found by factorising

Frequently asked questions

How many roots does a cubic have?

Three, counting repeated roots and complex roots. At least one is always real.

What if my equation has no x³ term?

Then it is a quadratic, so use the quadratic equation solver. The number a must not be zero here.

What is the rational root theorem?

It says any fraction p/q that is a root must have p dividing the constant term and q dividing the x³ number. Trying those few candidates is a quick way to find a first root.

What does a repeated root mean?

The curve touches the x axis and turns back instead of crossing it. For x³ - 3x² + 3x - 1, the root 1 appears three times.

Are the decimal answers exact?

They are accurate to many decimal places. When a root is a whole number or a fraction, it is found exactly and shown in that form too.