Cubic Equation Calculator
Enter coefficients a, b, c, d of ax³ + bx² + cx + d = 0 to find its roots.
What this calculator solves
A cubic equation ax3 + bx2 + cx + d = 0 has three roots counting multiplicity, and Cardano's method finds all of them: one real root with a complex pair, or three real roots, depending on the discriminant. The defaults solve x3 − 6x2 + 11x − 6 = 0, which factors as (x − 1)(x − 2)(x − 3) and therefore has roots 3, 2 and 1. The calculator reports the discriminant alongside the roots so you can see which case you are in.
The depressed cubic and the discriminant
The first substitution removes the quadratic term. Substituting x = t − b/(3a) turns the general cubic into the depressed form t3 + pt + q = 0, where p = c/a − b²/(3a²) and q = 2b³/(27a³) − bc/(3a²) + d/a. The discriminant Δ = (q/2)² + (p/3)³ then classifies the roots before any root is computed: its sign alone decides whether you get one real root, a repeated root, or three distinct real roots.
Worked example at the defaults
Solve x3 − 6x2 + 11x − 6 = 0, so a = 1, b = −6, c = 11, d = −6. Step 1: shift = b/(3a) = −2. Step 2: p = 11 − (−6)²/3 = 11 − 12 = −1. Step 3: q = 2 × (−216)/27 − (−6 × 11)/3 − 6 = −16 + 22 − 6 = 0. Step 4: Δ = 0²/4 + (−1)³/27 = −1/27 ≈ −0.037. Since Δ < 0 there are three distinct real roots, and the trigonometric branch returns x1 = 3, x2 = 2, x3 = 1 — exactly the factorization (x − 1)(x − 2)(x − 3).
Vieta checks
A quick Vieta check confirms all three roots: their sum 1 + 2 + 3 = 6 must equal −b/a = 6; the pairwise sum 1 × 2 + 1 × 3 + 2 × 3 = 11 must equal c/a = 11; and the product 1 × 2 × 3 = 6 must equal −d/a = 6. All three match, so the roots are correct without any further arithmetic.
What the discriminant tells you
| Discriminant | Root structure | Example |
|---|---|---|
| Δ > 0 | One real root plus a complex-conjugate pair | x3 − 1 = 0 gives x = 1 and two complex roots |
| Δ = 0 | All real, with a repeated root | (x − 2)²(x + 1) = 0 gives 2, 2, −1 |
| Δ < 0 | Three distinct real roots | Defaults give 3, 2, 1 |
The three cases correspond to how the cubic’s graph crosses the x-axis: three crossings when Δ < 0, a tangency or double crossing when Δ = 0, and a single crossing when Δ > 0. For the repeated-root example x3 − 3x2 + 4 = 0, the same computation gives p = −3 and q = 2, so Δ = 1 − 1 = 0 and the calculator returns the double root 2 alongside −1.
Common mistakes
Cubic problems add algebraic volume to the usual root-finding slips, and most errors trace to one of the following.
- Entering a = 0: the equation is then quadratic or worse, and Cardano’s divisions break down — use a quadratic solver instead.
- Sign slips in the depressed coefficients: with b = −6 the shift is −2, and forgetting to subtract it moves every root by 2.
- Reading Δ > 0 as three real roots: the inequality is the reverse of the quadratic convention, since (q/2)² + (p/3)³ must be negative for the trigonometric branch to apply.
- Expecting exact radicals for the defaults: Δ < 0 uses the casus irreducibilis, where real roots genuinely require trigonometry or numerical methods in this implementation.
- Checking only one root: with three roots, verify all with Vieta — the sum, pairwise sum and product checks each catch different errors.
Cubics versus quadratics
The structural difference is the odd degree: every real cubic crosses the x-axis at least once, so a purely complex answer is impossible, while a quadratic can hide entirely in the complex plane. The discriminant conventions flip accordingly — a negative quadratic discriminant means no real roots, but a negative cubic discriminant means the maximum case of three real roots. When a cubic has an obvious rational root r, synthetic division by (x − r) reduces it to the quadratic case, which is a useful hand check against the calculator’s output.
Where cubic equations appear
Volume problems are the classical source — a box with a square base of height-to-side constraints produces a cubic in the side length. Calculus uses cubics to locate critical points of quartic functions, since the derivative of a quartic is cubic. Economics and engineering fit cubic cost and stress models, and in 2026 numerical-analysis coursework the cubic is the standard demonstration problem for Newton’s method, where the roots 3, 2 and 1 of the default equation give three different basins of convergence from a single starting guess.
Frequently asked questions
What are the roots of x³ − 6x² + 11x − 6 = 0?
Three real roots: x = 3, x = 2 and x = 1, since the polynomial factors as (x − 1)(x − 2)(x − 3). The discriminant is about −0.037, which is negative, confirming three real roots.
How many real roots can a cubic have?
Either one real root plus a complex pair, or three real roots, decided by the sign of Δ = (q/2)² + (p/3)³. A negative Δ gives three real roots, zero gives a repeated root, and positive gives exactly one.
Why do complex roots show only a real part?
The numeric output shows the real component of the complex pair, because both members share the same real part −b/(3a)-adjusted value. The steps describe the pair rather than printing two numbers with imaginary components.
What is Cardano's method?
A classical procedure that shifts x by b/(3a) to remove the quadratic term, then solves the depressed cubic t³ + pt + q = 0 with cube roots or, when Δ < 0, an equivalent trigonometric formula. It was published in 1545 and still underlies textbook solutions.
What does a = 0 do?
The equation stops being cubic and the calculator reports that a must be non-zero. With a = 0, b ≠ 0 you have a quadratic and should use a quadratic solver for the correct two-root output.
How do I check cubic roots by hand?
Use Vieta’s formulas: the roots must sum to −b/a, multiply in pairs to c/a, and multiply all together to −d/a. For the defaults, 3 + 2 + 1 = 6, 3 × 2 + 3 × 1 + 2 × 1 = 11 and 3 × 2 × 1 = 6 all match.
Can a cubic have exactly two real roots?
Only by counting multiplicity: a double root counts twice, as in (x − 2)²(x + 1), which has the distinct values 2 and −1. Distinct real roots come only in counts of one or three.
Does the calculator handle negative coefficients?
Yes — the defaults already include b = −6 and d = −6. Signs feed straight into p, q and the shift, which is why the worked example’s arithmetic tracks every sign explicitly.
Method and sources
- Cardano's formula for solving the depressed cubic.