Calculate the root of a cubic equation from coefficients a, b, c, and d using Cardano’s formula, and show the steps and whether roots are real or complex.

Solve ax³ + bx² + cx + d = 0. Enter 0 for a missing term; a must be nonzero.


Related Calculators

Cardano’s Formula Formula

Cardano’s formula solves a cubic equation in the form:

a x³ + b x² + c x + d = 0

The calculator first converts the cubic to a depressed cubic using these quantities:

f = (3c / a - b² / a²) / 3
g = (2b³ / a³ - 9bc / a² + 27d / a) / 27
h = g² / 4 + f³ / 27

If h > 0, the cubic has one real root, and the calculator uses:

x = cubert(- g / 2 + sqrt(h)) + cubert(- g / 2 - sqrt(h)) - b / (3a)

If h ≤ 0, the cubic has three real roots or repeated real roots. When h < 0, the calculator returns the largest real root using the trigonometric form:

x = 2sqrt(- f / 3)cos((1 / 3)arccos((- g / 2) / sqrt(- f³ / 27))) - b / (3a)

When f = 0, the depressed cubic reduces to a simpler form:

x = - cubert(g) - b / (3a)
  • a, b, c, d are the coefficients of the cubic equation.
  • x is the root returned by the calculator.
  • f and g are the depressed cubic coefficients.
  • h determines the nature of the roots.
  • sqrt means square root.
  • cubert means cube root.

The calculator takes your values for a, b, c, and d, checks that a is not zero, calculates f, g, and h, then chooses the matching Cardano method. The result shows one real root of the cubic equation, choosing the largest when several exist. It uses scaled arithmetic, exact decimal-input root classification, and a residual check; values near repeated roots are numerically sensitive.

Root Type Based on h

Condition Root behavior Calculator method
h > 0 One real root and two complex roots Real cube-root form
h = 0 Three real roots, with at least two equal Repeated-root form
h < 0 Three distinct real roots Trigonometric form

Coefficient Setup for Common Cubic Forms

Cubic equation a b c d
x³ + x + 1 = 0 1 0 1 1
2x³ – 5x² + 3x – 7 = 0 2 -5 3 -7
x³ – 6x² + 11x – 6 = 0 1 -6 11 -6

Example Problems

Example 1: One real root

Solve:

x³ + x + 1 = 0

Here, a = 1, b = 0, c = 1, and d = 1.

f = 1
g = 1
h = 1² / 4 + 1³ / 27 = 0.287037

Since h > 0, there is one real root. The calculator returns approximately:

x = - 0.682328

Example 2: Three real roots

Solve:

x³ - 6x² + 11x - 6 = 0

Here, a = 1, b = -6, c = 11, and d = -6.

f = - 1
g = 0
h = 0² / 4 + (- 1)³ / 27 = - 0.037037

Since h < 0, the equation has three distinct real roots. The calculator returns the largest of them:

x = 3

FAQ

What equation form should I enter?

Enter the coefficients from a cubic equation written as ax³ + bx² + cx + d = 0. If a term is missing, use zero for that coefficient. For example, x³ + x + 1 = 0 has a = 1, b = 0, c = 1, and d = 1.

Why must a be nonzero?

The coefficient a is the coefficient of the x³ term. If a = 0, the equation is not cubic. It becomes a quadratic, linear, or constant equation, so Cardano’s formula does not apply.

Does Cardano’s formula give all three roots?

Cardano’s formula can be used to find all roots of a cubic, but this calculator displays one real root. When h > 0, that is the only real root. When h ≤ 0, all roots are real, with repetition possible; the displayed value is the largest real root.