Cubic Equation Calculator
Every cubic equation has three roots — counting complex ones and repetitions — and this solver finds them honestly. It first computes the discriminant exactly, which says what kind of roots to expect, then hunts for rational roots by exact arithmetic. When rational roots exist, the answers are exact — fractions and simplified radicals, not decimals in disguise.
When no rational root exists, the tool switches to the classical numeric routes — Cardano’s formula for the one-real-root case, the trigonometric method for three real roots — and labels those roots as approximations. Exact answers and approximations are both useful; pretending one is the other is the only real error, and this page never commits it.
Solve ax³ + bx² + cx + d = 0 for x.
Real roots
1, 2, 3
Found exactly — rational roots by exact arithmetic, the rest by exact radical formulas.
Discriminant Δ
4
Δ > 0 — three distinct real roots.
How it is worked out
- Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² = 4 (exact). Δ > 0 — three distinct real roots.
- The rational root theorem offers candidates p/q with p dividing -6 and q dividing 1; 1 is one — substituting it gives exactly 0.
- Dividing the cubic by (x − 1) leaves a quadratic, solved exactly.
- Every root shown is exact: rational roots print as fractions or decimals, irrational ones in simplified radical form.
Embed this calculator on your website →
The formula
Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²
- Reading Δ — positive: three distinct real roots. Zero: a repeated root. Negative: one real root and a complex-conjugate pair.
- Rational roots first — any rational root p/q (in lowest terms) has p dividing d and q dividing a. The tool tests every candidate exactly, then deflates the cubic to a quadratic and solves that exactly too.
Worked example: x³ − 6x² + 11x − 6 = 0 has Δ = 4 and roots 1, 2, 3 — exact.
How it works
The casus irreducibilis — when exact gets strange. Some cubics with three real roots cannot have those roots written with real radicals at all: Cardano’s formula detours through complex numbers even though every root is real. The trigonometric method sidesteps the detour, expressing the roots with cosines of a trisected angle — clean, stable, and necessarily approximate. x³ − 3x + 1 = 0 is the famous specimen: three real roots, no tidy form, and this page prints them as labeled approximations rather than inventing exactness.
Set a to zero and it is not a cubic. The tool refuses a = 0 and points at the quadratic solver — an honest boundary, because the discriminant formula, the root-count guarantees and the deflation all assume a genuine cubic. Degree is not a detail; it is the identity of the problem.
Examples
- One real root — x³ − 2 = 0: root 1.2599210499 (that is ∛2), with complex pair −0.6299605249 ± 1.091123636i; Δ = −108, method labeled approximate.
- A repeated root — x³ − 3x + 2 = (x − 1)²(x + 2): Δ = 0, roots −2 and 1 (twice), found exactly.
- Pure imaginary pair — x³ + x² + x + 1 = (x + 1)(x² + 1): root −1 and the pair ±i, exactly.
Frequently asked questions
What does the discriminant of a cubic tell me?
Everything about the shape of the answer before you compute it. Δ > 0: three distinct real roots. Δ = 0: a repeated root (two or all three coincide). Δ < 0: one real root and two complex conjugates. It plays the role for cubics that b² − 4ac plays for quadratics — and here it is computed in exact rational arithmetic, so its sign is never a rounding accident.
How does the solver find rational roots?
By the rational root theorem: any rational root, written in lowest terms as p/q, must have p dividing the constant term d and q dividing the leading coefficient a. That gives a finite candidate list, which the tool tests exactly. A hit lets it factor out (x − root) and solve the remaining quadratic with exact radical machinery — which is how roots like 1, 2, 3 or −1 and 1/2 come out as exact values instead of 0.9999999998.
Why are some roots labeled approximations?
Because they are. When a cubic has no rational root and its irrational roots have no neat radical form — or the robust way to get them is numeric — the tool computes them by the Cardano or trigonometric path in double precision and says so. You still get ten correct decimals, verified against high-precision references; you just also get the truth about their status.
What if a = 0?
Then the equation is a quadratic (or lower), and this tool refuses it and points you to the quadratic equation solver. Feeding a quadratic into cubic formulas would produce a discriminant of a different problem and roots of nothing in particular. Each solver on this site guards its own degree.
Related calculators
Quadratic Equation Calculator
LiveSolve ax² + bx + c = 0 with the discriminant, vertex, and factored form — roots printed exactly, in simplified radical form, or as a complex pair.
Scientific Calculator
LiveA full scientific keypad in your browser: sine, cosine and tangent in degrees or radians, logarithms, powers, roots and exact factorials — with brackets, memory, Ans and results shown to 12 significant digits.
Nth Root & Radicals Calculator
LiveAny root of any number: exact when the root comes out whole or fractional, simplified radical form (√12 = 2√3) with a labeled decimal beside it otherwise.

