Cubic Equation Solver

Solve cubic equations (ax³ + bx² + cx + d = 0) and find all three roots.

Solve ax³ + bx² + cx + d = 0

What Is the Cubic Equation Solver?

A cubic equation is a polynomial equation of degree 3 in the form ax³ + bx² + cx + d = 0, where a ≠ 0. Every cubic equation with real coefficients has at least one real root and up to three real roots. This solver uses Cardano's formula for one-real-root cases and the trigonometric (Viète) method when all three roots are real.

Formula

ax³ + bx² + cx + d = 0 Depressed form (substitute x = t − b/3a): t³ + pt + q = 0 p = (3ac − b²) / 3a² q = (2b³ − 9abc + 27a²d) / 27a³ Discriminant: Δ = −4p³ − 27q² Δ > 0 → three distinct real roots (trigonometric method) Δ = 0 → repeated root(s) Δ < 0 → one real root + two complex conjugates (Cardano's formula)

How to Use

Enter the four coefficients a, b, c, and d for ax³ + bx² + cx + d = 0. All four fields are required; a must be non-zero. Click Calculate to find all roots. The tool shows the depressed cubic form, the discriminant, and the step-by-step derivation of each root.

Example Calculation

Solve x³ − 6x² + 11x − 6 = 0 (a=1, b=−6, c=11, d=−6). The discriminant Δ > 0, so three real roots exist. Roots: x = 1, x = 2, x = 3 Verification: (x−1)(x−2)(x−3) = x³ − 6x² + 11x − 6 ✓

Understanding Cubic Equation

Cubic equations appear throughout mathematics, physics, and engineering. Finding the volume of a sphere given its surface area, computing the intersection of a line with a cubic Bézier curve, and solving certain kinematics problems all reduce to cubic equations.

The key insight in solving cubics is the substitution x = t − b/(3a), which eliminates the quadratic term and produces the simpler "depressed" form t³ + pt + q = 0. From there, the discriminant Δ = −4p³ − 27q² determines the nature of the roots.

When Δ > 0, all three roots are real and distinct. The trigonometric (Viète) method expresses them as t_k = 2√(−p/3) · cos(⅓ arccos(3q/(2p) · √(−3/p)) − 2πk/3) for k = 0, 1, 2, avoiding complex intermediate values.

When Δ < 0, one root is real and two are complex conjugates, computed via Cardano's formula using the cube root of complex numbers.

Frequently Asked Questions

What is a cubic equation?

A cubic equation is a polynomial of degree 3: ax³ + bx² + cx + d = 0. It always has exactly three roots (counting multiplicity) in the complex numbers.

What is Cardano's formula?

Cardano's formula (1545) gives the roots of a depressed cubic t³ + pt + q = 0 in closed form using cube roots. It is the cubic analogue of the quadratic formula.

When does a cubic have three real roots?

When the discriminant Δ = −4p³ − 27q² > 0 (of the depressed cubic), there are three distinct real roots, found using the trigonometric method.

Can the coefficient a be zero?

No. If a = 0, the equation reduces to a quadratic. Use the Quadratic Equation Solver instead.

How accurate are the results?

Roots are computed using JavaScript's 64-bit floating-point arithmetic, accurate to about 15 significant digits. Very small or very large coefficients may have reduced precision.

Related Tools