Cubic Equation Calculator

Cubic Equation Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

ax3+bx2+cx+d=0where{p=3ac−b23a2q=2b3−9abc+27a2d27a3Δ=−4p3−27q2\begin{gathered} \text{a}\,x^{3} + \text{b}\,x^{2} + \text{c}\,x + \text{d} = 0 \\[1.5em] \text{where}\quad \left\{ \begin{aligned} p &= \frac{3\,\text{a}\,\text{c} - \text{b}^{2}}{3\,\text{a}^{2}} \\ q &= \frac{2\,\text{b}^{3} - 9\,\text{a}\,\text{b}\,\text{c} + 27\,\text{a}^{2}\,\text{d}}{27\,\text{a}^{3}} \\ \Delta &= -4p^{3} - 27q^{2} \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Number of Real Roots
3 real
Δ = 4
Root Real part Imaginary part
x₁ 1 0
x₂ 2 0
x₃ 3 0

Report an error on this page

What is the Cubic Equation Calculator?

This tool solves any cubic equation of the form \(ax^3 + bx^2 + cx + d = 0\), finding all three roots — whether they are real or complex. It uses Cardano's method together with the trigonometric (casus irreducibilis) solution so results stay numerically stable.

How to use it

Enter the four coefficients \(a\), \(b\), \(c\) and \(d\). The coefficient \(a\) must be non-zero for the equation to be cubic. The calculator returns the discriminant, how many real roots exist, and the real and imaginary parts of each root.

Three sign cases of the cubic discriminant
The discriminant's sign tells you whether the cubic has three real roots, a repeated root, or one real and two complex roots.

The formula explained

First we remove the quadratic term by substituting \(x = t - b/(3a)\), giving the depressed cubic \(t^3 + pt + q = 0\) where $$p = \frac{3ac - b^2}{3a^2}$$ and $$q = \frac{2b^3 - 9abc + 27a^2d}{27a^3}.$$ The discriminant $$\Delta = -4p^3 - 27q^2$$ decides the nature of the roots: \(\Delta > 0\) gives three distinct real roots, \(\Delta = 0\) gives repeated real roots, and \(\Delta < 0\) gives one real root plus a complex-conjugate pair. When all roots are real we use $$t_k = 2\sqrt{-\frac{p}{3}}\cdot\cos\left(\frac{1}{3}\cdot\operatorname{acos}\left(\frac{3q}{p\cdot 2\sqrt{-\frac{p}{3}}}\right) - \frac{2\pi k}{3}\right).$$

Advertisement

Worked example

For \(x^3 - 6x^2 + 11x - 6 = 0\) we have \(a=1\), \(b=-6\), \(c=11\), \(d=-6\). The depressed cubic gives \(p = -\frac{1}{3}\) and \(q = -0.0741\). The discriminant is positive, yielding three real roots, which the calculator sorts to \(1\), \(2\) and \(3\) — exactly the factorisation \((x-1)(x-2)(x-3)\).

Cubic curve crossing the x-axis at three points
The real roots of a cubic are where its curve crosses the x-axis.

FAQ

What if \(a = 0\)? Then it is not a cubic; this tool requires \(a \neq 0\).

Why are some roots complex? A cubic always has three roots in the complex numbers; when the discriminant is negative, two of them form a conjugate pair.

In what order are roots listed? Real roots are sorted in ascending order for consistency.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators