Skip to content
The Calculatorz
Algebra

Cubic Equation Solver

Solve any cubic equation ax³ + bx² + cx + d = 0 and find all real and complex roots, with the discriminant.

Coefficients

Equation

How to use this calculator

Enter the four coefficients of ax³ + bx² + cx + d = 0; a must not be zero. The calculator finds all three roots, including repeated and complex ones, tells you how many are real from the discriminant, and checks each root by substitution.

Formula

Discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². Δ > 0: three distinct real roots; Δ = 0: a repeated root; Δ < 0: one real and two complex roots. Roots are found from the depressed cubic t³ + pt + q = 0 (x = t − b ÷ 3a) with the trigonometric method or Cardano's formula.

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewIfrahMSc Mathematics

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

How many roots does a cubic have?

Always three, counting repeated and complex roots. At least one is real, because a cubic graph must cross the x-axis.

What does the discriminant tell me?

Its sign shows the type of roots: positive for three different real roots, zero for a repeated root, negative for one real and two complex roots.

What is Cardano's formula?

A 16th-century formula that solves the depressed cubic t³ + pt + q = 0 with cube roots. It was published by Gerolamo Cardano in 1545.

Can I factor a cubic myself?

Try the rational root theorem: test factors of d divided by factors of a. If one works, divide by (x − root) to get a quadratic.

What if a = 0?

Then the equation is quadratic, not cubic. Use the Quadratic Formula Calculator.

Why do complex roots come in pairs?

For real coefficients, complex roots appear as conjugates a + bi and a − bi.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Olver, F. W. J., Lozier, D. W., Boisvert, R. F., & Clark, C. W. (Eds.). (2024). NIST Digital Library of Mathematical Functions. National Institute of Standards and Technology. View source
  2. Abramson, J. (2021). College algebra 2e. OpenStax. View source
  3. Abramson, J. (2021). Precalculus 2e. OpenStax. View source
  4. International Organization for Standardization. (2019). ISO 80000-2: Quantities and units—Part 2: Mathematics. View source