User Rating 0.0
Total Usage 0 times
ax3 + bx2 + cx + d = 0
Leading coefficient, must ≠ 0 for cubic
Is this tool helpful?

Your feedback helps us improve.

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.

cubic equation cardano formula polynomial solver cubic roots discriminant complex roots algebra calculator

Formulas

The general cubic equation is first converted to the depressed cubic by substituting x = t b3a, yielding:

t3 + pt + q = 0

where the intermediate coefficients are:

p = 3ac b23a2
q = 2b3 9abc + 27a2d27a3

The discriminant of the original cubic is:

Δ = 18abcd 4b3d + b2c2 4ac3 27a2d2

For the depressed cubic, define:

Δ0 = b2 3ac
Δ1 = 2b3 9abc + 27a2d

When Δ > 0 (three real roots), the trigonometric method is used:

xk = 2p3 cos(13 arccos(3q2p 3p) 2πk3) b3a

for k = 0, 1, 2.

When Δ 0, Cardano's direct formula computes:

C = Δ1 ± Δ12 4Δ032

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 ConditionRoot ClassificationExample EquationRoots
Δ > 0Three distinct real rootsx3 6x2 + 11x 6 = 01, 2, 3
Δ = 0 (with Δ0 0)One simple root + one double rootx3 3x + 2 = 01 (double), −2
Δ = 0 (with Δ0 = 0)One triple rootx3 3x2 + 3x 1 = 01 (triple)
Δ < 0One real root + two complex conjugatesx3 + x + 1 = 0−0.6824, 0.3412 ± 1.1615i
Notable Cubic Identities & Special Forms
Sum of cubesa3 + b3(a + b)(a2 ab + b2)
Difference of cubesa3 b3(a b)(a2 + ab + b2)
Perfect cube(a + b)3a3 + 3a2b + 3ab2 + b3
Depressed cubict3 + pt + q = 0Obtained by substituting x = t b3a
Vieta's Formulas for x3 + px2 + qx + r = 0
x1 + x2 + x3= px1x2 + x1x3 + x2x3= q
x1x2x3= r(Product of roots equals negative constant term)
Historical Milestones
1545Cardano publishes Ars MagnaFirst general algebraic solution of the cubic
1572Bombelli introduces complex numbersResolved casus irreducibilis paradox
1637Descartes' La GéométrieModern algebraic notation standardized
1799Fundamental Theorem of AlgebraEvery degree-n polynomial has exactly n roots in C

Frequently Asked Questions

When a = 0, the equation is no longer cubic. The calculator automatically falls back to the quadratic formula x = b ± b2 4ac2a (using the remaining non-zero coefficients as the quadratic parameters). If both a and b are zero, it reduces further to a linear equation.
The casus irreducibilis occurs when Δ > 0 (three distinct real roots) but Cardano's formula produces intermediate complex cube roots. Naively computing real cube roots of complex numbers introduces floating-point errors. This calculator avoids the problem entirely by switching to Vieta's trigonometric method in that case, using arccos and cos which are numerically stable in IEEE 754 arithmetic.
Δ > 0 means three distinct real roots. Δ = 0 means at least two roots coincide (a repeated root). Δ < 0 means one real root and two complex conjugate roots. The discriminant formula Δ = 18abcd 4b3d + b2c2 4ac3 27a2d2 generalizes the quadratic discriminant b2 4ac to the third degree.
JavaScript uses IEEE 754 double-precision floats with approximately 15-17 significant decimal digits. Coefficients within ±1015 yield reliable results. Beyond that range, the discriminant computation may overflow or lose precision. For coefficients exceeding 10100, specialized arbitrary-precision arithmetic libraries would be required.
Complex roots are displayed in the standard form a ± bi. The calculator verifies each root by substituting it back into the original polynomial and checking that the residual |f(x)| < 10−8. Complex conjugate pairs always share the same real part and have imaginary parts of equal magnitude but opposite sign, which is enforced by the algorithm.
Cardano's formula involves nested cube roots and square roots, each introducing rounding error of order ε 2.2 × 10−16. One or two Newton-Raphson iterations (xn+1 = xn f(xn)f(xn)) polish the root to near machine epsilon, quadratically converging since the analytical solution is already close.