A cubic equation has the form ax³ + bx² + cx + d = 0 with a ≠ 0. Unlike a quadratic, there is no short formula worth memorizing, so this calculator chooses the cleanest route for your coefficients: it looks for a rational root first and solves the rest exactly, and falls back on Cardano’s formula or the trigonometric method when the roots are irrational.
How to use the cubic equation calculator
- Move every term to one side so the equation equals zero.
- Enter the coefficients a (x³), b (x²), c (x) and d (constant). Type 0 for any missing term.
- Read the three roots on the tape. Exact forms appear when they exist, with decimals underneath; complex roots are written as p ± qi.
- Open the steps to see the discriminant, the method and each intermediate value. The graph shows the real roots and the inflection point.
Cubic equation formulas
The discriminant tells you what kind of roots to expect before you solve anything:
Substituting x = t − b/(3a) removes the x² term and leaves the depressed cubic:
When Δ < 0 there is one real root, given by Cardano’s formula:
When Δ > 0 there are three real roots, found with the trigonometric method for k = 0, 1, 2:
Worked example
Solve 2x³ − 3x² − 11x + 6 = 0.
Discriminant: 7,128 + 648 + 1,089 + 10,648 − 3,888 = 15,625. It is positive, so expect three distinct real roots.
Rational root test: a rational root p/q must have p dividing 6 and q dividing 2, so the candidates are ±1, ±2, ±3, ±6, ±1/2 and ±3/2. Trying x = 3 gives 54 − 27 − 33 + 6 = 0, so 3 is a root.
Synthetic division by (x − 3) leaves 2x² + 3x − 2, which factors as (2x − 1)(x + 2).
Roots: x = 3, x = 1/2 and x = −2.
Not every cubic is that friendly. For x³ − 3x + 1 = 0, Δ = 81 but none of the candidates ±1 work, so the trigonometric method gives x ≈ 1.5320888862, 0.3472963553 and −1.8793852416. For x³ − 2 = 0, Δ = −108: the real root is ∛2 ≈ 1.2599210499 and the complex pair is −0.6299605249 ± 1.091123636i.
Interpreting the result
| Discriminant | Roots | Shape of the graph |
|---|---|---|
| Δ > 0 | three different real roots | crosses the x-axis three times |
| Δ = 0, p ≠ 0 | a double root and a single root | touches the axis at one point, crosses at another |
| Δ = 0, p = 0 | one triple root | flattens out as it crosses the axis |
| Δ < 0 | one real root, two complex conjugates | crosses the axis once |
Two quick checks work for any cubic: the three roots add up to −b/a and multiply to −d/a. In the example, 3 + 1/2 − 2 = 3/2, which matches −(−3)/2, and 3 × 1/2 × (−2) = −3, which matches −6/2.
A little history
Scipione del Ferro and Niccolò Tartaglia solved the depressed cubic in sixteenth-century Italy, and Gerolamo Cardano published the method in his Ars Magna in 1545. The puzzling cases where real answers required square roots of negative numbers pushed Rafael Bombelli to write down the first rules for complex arithmetic, so cubic equations are the reason complex numbers exist at all.
For second-degree equations use the quadratic formula calculator, and for a single cube root see the cube root calculator.
Frequently asked questions
How many roots does a cubic equation have?
Exactly three when you count complex roots and repeated roots. At least one root is always real, because the graph of a cubic runs from minus infinity to plus infinity and must cross the x-axis.
What does the cubic discriminant mean?
Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d². If Δ is positive there are three distinct real roots, if Δ is zero there is a repeated root and all roots are real, and if Δ is negative there is one real root plus a pair of complex conjugate roots.
Why are some roots exact and others decimals?
If the cubic has a rational root, the calculator divides it out and solves the leftover quadratic exactly. When no rational root exists, the exact radical form from Cardano's formula is usually long and unhelpful, so the roots are shown as decimals to ten places.
What is the casus irreducibilis?
It is the case of three real roots with no rational root, such as x³ − 3x + 1 = 0. Cardano's formula then needs cube roots of complex numbers even though every answer is real, so the trigonometric method is used instead.
What if a = 0?
Then the equation has no x³ term and is really a quadratic (or linear) equation. The calculator says so and solves the lower-degree equation.