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.
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).$$
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)\).
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.