StatGardenREF. DESK
Calculators/Maths/Cubic equation
Maths

Cubic equation calculator

Real roots of ax³ + bx² + cx + d = 0 via Cardano’s method.

Published 6 August 2026 · Updated 23 September 2026

What this calculator does

Every cubic has at least one real root, because the curve runs from minus infinity to plus infinity and must cross zero somewhere. Whether it has one or three is decided by the discriminant.

Cardano published the method in 1545, and it involves a genuine oddity: when there are three real roots, the formula reaches them through complex numbers. That awkwardness is part of why complex numbers were taken seriously in the first place.

The formula

FormulaDepressed cubic t³+pt+q=0 via x=t−b/3a; discriminant Δ=(q/2)²+(p/3)³ decides one vs three real roots

Substituting shifts the cubic into depressed form with no squared term. The discriminant of that form determines the root structure, and Cardano's formula or a trigonometric method recovers the roots.

TermMeaning
Depressed cubicThe form with no squared term, reached by a substitution.
DiscriminantPositive gives one real root, zero gives repeated roots, negative gives three distinct real roots.
Casus irreducibilisThe three-real-root case, where the algebraic formula unavoidably passes through complex numbers.

The inputs explained

FieldWhat to enter
aCoefficient of x cubed. Cannot be zero.
bCoefficient of x squared.
cCoefficient of x.
dThe constant term.

When to use it

Solving a cubic exactly

Factorising only works when the roots are rational; this handles any cubic.

Finding where a curve crosses zero

The real roots are the x-intercepts of the cubic.

Checking a factorisation

The roots confirm whether a proposed factoring is right.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does the constant change the root structure?

The same cubic with four constant terms.

x³ − 6x² + 11x + d
Constant dReal root(s)Number of real roots
d = -61, 2, 33
d = -20.2036781
d = 2-0.1663131
d = 6-0.4348411
At d = −6 the cubic factors neatly as (x−1)(x−2)(x−3) and returns all three roots. Shifting the constant to −2 or beyond lifts the curve so it crosses zero only once, leaving a single real root and two complex ones.

Questions

Why does every cubic have at least one real root?

Because a cubic is continuous and heads to opposite infinities at each end. The intermediate value theorem then guarantees it crosses zero somewhere, however the coefficients are arranged.

What is casus irreducibilis?

The historically awkward case where a cubic has three distinct real roots but Cardano's formula can only reach them through complex numbers. It cannot be avoided algebraically, and it did a great deal to establish complex numbers as legitimate.

Is there a formula for quartics too?

Yes, published by Ferrari shortly after Cardano, though it is considerably more involved. Beyond fourth degree no general formula in radicals exists, which Abel and Galois proved in the nineteenth century.

Why can the roots look slightly off?

Because Cardano's method involves cube roots and square roots of computed quantities, and floating point error accumulates through them. A root that should be exactly zero may come back as a very small number instead.

For quadratics, see the quadratic calculator. For testing candidate roots, see the synthetic division calculator.