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.

Cardano’s Formula Calculator


Related Calculators

Cardano’s Formula Formula

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

a x^3 + b x^2 + c x + d = 0

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

f = (3c/a - b^2/a^2)/3
g = (2b^3/a^3 - 9bc/a^2 + 27d/a)/27
h = g^2/4 + f^3/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. The calculator returns one real root using the trigonometric form:

x = 2sqrt(-f/3)cos((1/3)arccos((-g/2)/sqrt(-f^3/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 field shows one real root of the cubic equation.

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 Trigonometric or simplified real-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^3 + x + 1 = 0

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

f = 1
g = 1
h = 1^2/4 + 1^3/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^3 - 6x^2 + 11x - 6 = 0

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

f = -1
g = 0
h = 0^2/4 + (-1)^3/27 = -0.037037

Since h < 0, the equation has three distinct real roots. The calculator returns one 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 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, the equation has multiple real roots, and the displayed value is one of them.