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.
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.