Skip to content

Cubic Equation Calculator

All real roots, including the case Cardano cannot reach directly.

Work out Cubic Equation. All real roots, including the case Cardano cannot reach directly. Shows the working, not just the answer.

Written and maintained by Mohit PatelLast checked August 4, 2026How we build these

Real roots

1, 2, 3

Three distinct real roots

Root 11
Root 22
Root 33
Real roots3
Discriminant4
NatureThree distinct real roots

Every cubic has at least one real root, because the curve runs from −∞ to +∞ and must cross the axis somewhere. It has either one or three, never two. Where there are three, the algebraic solution requires a cube root of a complex number — the casus irreducibilis — and a direct implementation of Cardano's formula returns NaN for three perfectly ordinary real answers. This uses the trigonometric substitution instead, which stays entirely in real arithmetic. Complex roots always come in conjugate pairs for a polynomial with real coefficients, which is why two real roots is impossible.

How the Cubic Equation Calculator works

Enter four coefficients for every real root. Where a cubic has three of them the algebraic formula requires a cube root of a complex number, and a direct implementation returns NaN — this uses the trigonometric substitution, which stays in real arithmetic throughout.

Also known as: solve a cubic equation · cubic formula calculator · cardano formula calculator · roots of a cubic

Frequently asked questions

How many roots does a cubic have?

Either one real root or three, never two. The curve runs from −∞ to +∞ so it must cross the axis at least once, and complex roots for a real polynomial always come in conjugate pairs — which rules out exactly two.

What is the casus irreducibilis?

The case where a cubic has three distinct real roots but Cardano's algebraic formula can only reach them through complex numbers. It is why a direct implementation returns NaN for perfectly ordinary answers, and why the trigonometric form is used instead.

How does the trigonometric method work?

Depress the cubic to remove the x² term, then substitute a cosine. The three roots fall out as three cosines spaced 120° apart, with no complex arithmetic anywhere.

Can every polynomial be solved this way?

Up to degree four, yes — there are formulas for cubics and quartics. From degree five there is no general formula in radicals at all, which Abel proved in 1824. Higher degrees need numerical methods.

Put this calculator on your own site

Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.

The one-line version
<iframe src="https://www.thecalclibrary.com/embed/cubic-equation-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Cubic Equation Calculator"></iframe>
<p style="font:13px/1.5 system-ui,sans-serif;margin:6px 0 0;color:#64748b">Powered by <a href="https://www.thecalclibrary.com/cubic-equation-calculator" style="color:#64748b">Cubic Equation Calculator</a> from The Calc Library</p>

The only condition is that the credit line below the frame stays in place. That one line is what pays for the tool being free — it is how anyone else finds it.

Related calculators