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
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.
| Term | Meaning |
|---|---|
| Depressed cubic | The form with no squared term, reached by a substitution. |
| Discriminant | Positive gives one real root, zero gives repeated roots, negative gives three distinct real roots. |
| Casus irreducibilis | The three-real-root case, where the algebraic formula unavoidably passes through complex numbers. |
The inputs explained
| Field | What to enter |
|---|---|
| a | Coefficient of x cubed. Cannot be zero. |
| b | Coefficient of x squared. |
| c | Coefficient of x. |
| d | The 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.
| Constant d | Real root(s) | Number of real roots |
|---|---|---|
| d = -6 | 1, 2, 3 | 3 |
| d = -2 | 0.203678 | 1 |
| d = 2 | -0.166313 | 1 |
| d = 6 | -0.434841 | 1 |
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.