Skip to main content

Cubic Equation Calculator

Solve ax³ + bx² + cx + d = 0 with Cardano's method - all 3 roots, discriminant analysis, steps & graph

Enter coefficients

Cubic equation - frequently asked questions

What is a cubic equation?

A cubic equation is a polynomial equation of degree 3: ax³ + bx² + cx + d = 0 with a ≠ 0. It always has exactly 3 roots counting multiplicity, and at least one of them is always real.

How does this cubic equation calculator solve the equation?

It uses Cardano's method: (1) divide by a to get a monic cubic x³ + Bx² + Cx + D = 0; (2) depress it with x = t − B/3 to get t³ + pt + q = 0 where p = C − B²/3 and q = 2B³/27 − BC/3 + D; (3) compute the discriminant Δ = −(4p³ + 27q²); (4) use the trigonometric form when Δ > 0 and the real Cardano formula when Δ ≤ 0; (5) back-substitute x = t − B/3.

What is the discriminant of a cubic equation?

For the depressed cubic t³ + pt + q = 0 the discriminant is Δ = −(4p³ + 27q²). Δ > 0 means three distinct real roots, Δ = 0 means a multiple root, and Δ < 0 means one real root plus two complex conjugate roots. Example: x³ − 6x² + 11x − 6 = 0 gives p = −1, q = 0, Δ = 4 > 0, and indeed the roots are x = 1, 2, 3.

What does it mean when the discriminant is zero?

Δ = 0 means at least two roots coincide (a multiple root). Example: x³ − 3x + 2 = 0 has p = −3, q = 2, Δ = 0, and factors as (x − 1)²(x + 2), so x = 1 is a double root and x = −2 is a single root. If additionally p = q = 0 you get a triple root, e.g. x³ − 3x² + 3x − 1 = (x − 1)³.

What is casus irreducibilis?

It is the case Δ > 0: all three roots are real, yet Cardano's formula expresses them with cube roots of complex numbers. Taking complex cube roots with ordinary floating-point arithmetic produces NaN, so this calculator uses the trigonometric form instead: tₖ = 2√(−p/3)·cos((θ − 2kπ)/3), k = 0, 1, 2, with θ = arccos((3q/2p)√(−3/p)). Purely real arithmetic, no NaN.

Why does x³ + x + 1 = 0 have only one real root?

Here p = 1, q = 1, so Δ = −(4 + 27) = −31 < 0: one real root plus a complex conjugate pair. The roots are x ≈ −0.6823278038 and x ≈ 0.3411639019 ± 1.1615414000i.

Can a cubic equation have no real roots?

No. Every cubic with real coefficients has an odd degree, so f(x) → −∞ on one side and +∞ on the other; by continuity it must cross zero at least once. There is always at least one real root; the other two are either both real (Δ ≥ 0) or a complex conjugate pair (Δ < 0).

What is the depressed cubic?

Substituting x = t − b/(3a) removes the quadratic term and leaves t³ + pt + q = 0 with p = c/a − (b/a)²/3 and q = 2(b/a)³/27 − (b/a)(c/a)/3 + d/a. Cardano's formula then only needs p and q, which is why every cubic solver starts with this step.

How do I check that the computed roots are correct?

Use Vieta's formulas: r₁+r₂+r₃ = −b/a, r₁r₂+r₁r₃+r₂r₃ = c/a, r₁r₂r₃ = −d/a. For x³ − 6x² + 11x − 6 = 0 with roots 1, 2, 3: 1+2+3 = 6 = −(−6)/1, 1·2+1·3+2·3 = 11 = 11/1, 1·2·3 = 6 = −(−6)/1. The calculator shows these residuals (they should be ~10⁻¹⁶).

What is a triple root?

All three roots coincide, e.g. x³ − 3x² + 3x − 1 = (x − 1)³ has the triple root x = 1. In Cardano's form this is exactly p = 0 and q = 0 (hence Δ = 0), and the root is x = −b/(3a).

What happens if a = 0?

Then it is not a cubic equation at all — ax³ + bx² + cx + d = 0 degenerates to the quadratic bx² + cx + d = 0. This calculator requires a ≠ 0 and reports an error otherwise; use a quadratic equation solver for that case.

How are complex roots displayed?

As a ± bi, e.g. x³ − 2x² + x − 2 = (x − 2)(x² + 1) has roots x = 2, x = 0 + 1i, x = 0 − 1i. For x³ − 2 = 0 the roots are x ≈ 1.2599210499 and x ≈ −0.6299605249 ± 1.0911236360i.

What is the difference between this and a quadratic equation solver?

A quadratic equation solver handles degree-2 equations (ax² + bx + c = 0) with the quadratic formula, while this tool solves degree-3 equations (ax³ + bx² + cx + d = 0) with Cardano's method — a genuinely different algorithm and problem. See the related quadratic equation solver link below.

Is Cardano's method exact?

The formulas are mathematically exact; the calculator evaluates them in double-precision floating point (about 15–16 correct digits). Integer roots like 1, 2, 3 come out exact to ~10⁻¹⁶, and the Vieta residuals shown under the roots let you verify the accuracy for every input.

Free tool by NRTechStudio