Calculateus

Cubic Equation Solver

Solve a cubic equation of the form ax³ + bx² + cx + d = 0 using Cardano's formula.

Result

Real Root(s)
3, 1, 2
Number of Real Roots
3

Uses the substitution x = t - b/3a to eliminate the quadratic term, then Cardano's formula on the resulting depressed cubic t³ + pt + q = 0. When the discriminant is negative, all three roots are real and found using the trigonometric form of Cardano's method.

About the Cubic Equation Solver

The Cubic Equation Solver finds the real root or roots of an equation in the form ax^3 + bx^2 + cx + d = 0, using Cardano's classical method rather than trial and error or graphing. Enter the four coefficients and the calculator returns every real solution, saving you the tedious algebra of depressing the cubic and applying the cubic formula by hand.

How It Works

You supply the coefficients a, b, c, and d. The calculator first converts the equation into a depressed cubic (one with no squared term) through the substitution x = t - b/3a, then computes a discriminant to decide whether the equation has one real root or three. It reports the real root count and lists each real root rounded to four decimal places.

p = (3ac - b^2) / (3a^2); q = (2b^3 - 9abc + 27a^2d) / (27a^3); discriminant = q^2/4 + p^3/27. If discriminant > 0: one real root, x = cbrt(-q/2 + sqrt(disc)) + cbrt(-q/2 - sqrt(disc)) - b/3a. If discriminant <= 0: three real roots via x = 2*sqrt(-p/3) * cos((phi + 2*pi*k)/3) - b/3a for k = 0, 1, 2, where phi = acos(-q / (2*sqrt(-(p^3)/27))).

Formula & Methodology

By hand, the process starts with the same substitution the calculator uses: shifting x by -b/3a removes the quadratic term and leaves a depressed cubic t^3 + pt + q = 0. From there you compute the discriminant q^2/4 + p^3/27. A positive discriminant means the cubic has one real root and two complex conjugates, found with two cube roots (Cardano's original formula). A discriminant at or below zero signals three real roots, which the calculator recovers using the trigonometric form because taking real cube roots of the intermediate complex quantities directly is error-prone by hand.

Examples

Three real roots

For x^3 - 6x^2 + 11x - 6 = 0 (a=1, b=-6, c=11, d=-6), the discriminant works out negative, so the trigonometric branch runs and returns the three real roots 1, 2, and 3.

One real root

For x^3 + 3x - 4 = 0 (a=1, b=0, c=3, d=-4), the discriminant is positive, so Cardano's direct formula applies and returns a single real root, x = 1.

Advantages

  • Avoids the lengthy manual algebra of depressing a cubic and evaluating nested cube roots by hand.
  • Automatically switches between the algebraic and trigonometric forms of Cardano's method depending on the discriminant, so it correctly handles both one-root and three-root cases.
  • Displays the exact number of real roots found, making it easy to see at a glance whether the equation factors into three real solutions or has complex conjugate pairs.

Common Mistakes

  • Forgetting that a cubic with a negative discriminant still has three real roots, and mistakenly assuming a negative value under a square root means no real solutions exist.
  • Entering a as zero, which turns the equation into a quadratic or lower and is outside what this solver is built to handle.
  • Misreading the coefficient order and swapping which number goes with x^3 versus the constant term, which produces a completely different equation.

Edge Cases to Watch For

  • If a is entered as 0, the equation stops being cubic, so the calculator returns an error rather than silently solving it as a quadratic.
  • When the discriminant is exactly 0, the cubic has a repeated root; the trigonometric branch still runs and will report that value more than once among the three listed roots.
  • Very large or very small coefficients can push intermediate cube-root and arccosine calculations to the edge of floating-point precision, so roots near a double repeated root may show small rounding artifacts in the fourth decimal place.

Common Use Cases

  • Students checking cubic equation homework or verifying the roots found through factoring or synthetic division.
  • Engineers or physics learners who need a quick real-root solution to a cubic that arises from a modeling problem.
  • Anyone verifying that a cubic factors as expected, such as confirming integer roots before attempting factoring by hand.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

Does every cubic equation have at least one real root?

Yes - unlike quadratics, every cubic equation with real coefficients has at least one real root, since a cubic function's graph always crosses the x-axis at least once (it goes from negative to positive infinity, or vice versa, as x runs from -∞ to +∞). It can have either one real root and two complex conjugate roots, or three real roots.

Conclusion

The Cubic Equation Solver applies Cardano's formula in full, including the trigonometric case for three real roots, so it handles the general cubic without requiring you to guess which method to apply. It is a fast way to confirm hand calculations or explore how changing coefficients shifts the roots.