Cubic Equation Calculator
Solve any cubic equation ax³ + bx² + cx + d = 0 using Cardano's formula. Get all real and complex roots with step-by-step discriminant analysis.
About
A cubic equation ax3 + bx2 + cx + d = 0 always has three roots in the complex plane, counted with multiplicity. The nature of those roots - three distinct reals, a repeated real, or one real with two complex conjugates - depends entirely on the sign of the discriminant Δ. Misclassifying root type leads to incorrect factorizations in engineering filter design, control system pole placement, and structural eigenvalue analysis. This calculator applies Cardano's analytical method with Vieta's trigonometric refinement when Δ > 0, avoiding the numerical instability that plagues naive implementations near the casus irreducibilis.
The tool assumes a ≠ 0. If a = 0, the equation degenerates to a quadratic, which is handled separately via the standard quadratic formula. All roots are refined with a Newton-Raphson polishing pass. Results are accurate to 10 significant digits for coefficients within ±1015. Note: for coefficients exceeding IEEE 754 double-precision range, rounding artifacts may appear.
Formulas
The general cubic equation is first converted to the depressed cubic by substituting x = t − b3a, yielding:
where the intermediate coefficients are:
The discriminant of the original cubic is:
For the depressed cubic, define:
When Δ > 0 (three real roots), the trigonometric method is used:
for k = 0, 1, 2.
When Δ ≤ 0, Cardano's direct formula computes:
where a = leading coefficient, b = quadratic coefficient, c = linear coefficient, d = constant term, p = depressed cubic linear coefficient, q = depressed cubic constant, Δ = discriminant, k = root index.
Reference Data
| Discriminant Condition | Root Classification | Example Equation | Roots |
|---|---|---|---|
| Δ > 0 | Three distinct real roots | x3 − 6x2 + 11x − 6 = 0 | 1, 2, 3 |
| Δ = 0 (with Δ0 ≠ 0) | One simple root + one double root | x3 − 3x + 2 = 0 | 1 (double), −2 |
| Δ = 0 (with Δ0 = 0) | One triple root | x3 − 3x2 + 3x − 1 = 0 | 1 (triple) |
| Δ < 0 | One real root + two complex conjugates | x3 + x + 1 = 0 | −0.6824, 0.3412 ± 1.1615i |
| Notable Cubic Identities & Special Forms | |||
| Sum of cubes | a3 + b3 | (a + b)(a2 − ab + b2) | |
| Difference of cubes | a3 − b3 | (a − b)(a2 + ab + b2) | |
| Perfect cube | (a + b)3 | a3 + 3a2b + 3ab2 + b3 | |
| Depressed cubic | t3 + pt + q = 0 | Obtained by substituting x = t − b3a | |
| Vieta's Formulas for x3 + px2 + qx + r = 0 | |||
| x1 + x2 + x3 | = −p | x1x2 + x1x3 + x2x3 | = q |
| x1x2x3 | = −r | (Product of roots equals negative constant term) | |
| Historical Milestones | |||
| 1545 | Cardano publishes Ars Magna | First general algebraic solution of the cubic | |
| 1572 | Bombelli introduces complex numbers | Resolved casus irreducibilis paradox | |
| 1637 | Descartes' La Géométrie | Modern algebraic notation standardized | |
| 1799 | Fundamental Theorem of Algebra | Every degree-n polynomial has exactly n roots in C | |