🧮 Cubic Equation Solver
By ToolNimba Math Team · Updated 2026-06-19
Solve ax3 + bx2 + cx + d = 0. Enter the four coefficients below.
Enter coefficients a, b, c and d to solve the equation.
A cubic equation is any equation that can be written as ax³ + bx² + cx + d = 0, where a is not zero. This solver finds all of its roots: enter the four coefficients a, b, c and d, and it returns up to three solutions, real or complex, along with the discriminant that tells you what kind of roots to expect. Every cubic has exactly three roots (counting repeats), and at least one of them is always real.
What is the Cubic Equation Solver?
A cubic, or third-degree polynomial, equation has the general form ax³ + bx² + cx + d = 0 with a ≠ 0. Unlike a quadratic, which can have no real roots at all, a cubic always crosses the x-axis at least once because its graph runs from negative infinity to positive infinity (or the reverse). That guarantees at least one real root. The remaining two roots are either both real or a pair of complex conjugates.
The solver works the way Cardano's method does. First it divides through by a to get a monic equation x³ + px² + qx + r = 0. Then it removes the squared term with the substitution x = t - p/3, producing a depressed cubic t³ + ft + g = 0 that is much easier to handle. The sign of the discriminant Δ = g²/4 + f³/27 then decides everything: a positive Δ means one real root and two complex conjugates, a zero Δ means all roots are real with at least two of them equal, and a negative Δ means three distinct real roots.
For the three-distinct-real case, the radical version of Cardano's formula would force you to take cube roots of complex numbers even though the answers are real, the so-called casus irreducibilis. To avoid that, this tool switches to the trigonometric (Vieta) form, t = 2√(-f/3)·cos(θ/3 - 2πk/3), which gives all three real roots cleanly. The constant p/3 is then added back to convert each t into the original x.
When to use it
- Finding where a cubic function crosses the x-axis when graphing or analysing a curve.
- Solving for equilibrium points or break-even quantities in models that produce a third-degree polynomial.
- Checking homework or exam answers for algebra and precalculus cubic problems.
- Locating the real root of a cubic that comes out of a physics, engineering or volume calculation.
How to use the Cubic Equation Solver
- Enter coefficient a (the multiplier of x³). If a is 0 the tool solves the lower-degree equation instead.
- Enter coefficient b (the multiplier of x²).
- Enter coefficient c (the multiplier of x).
- Enter the constant term d, then read off the three roots and the discriminant, which updates instantly.
Formula & method
Worked examples
Solve x³ - 6x² + 11x - 6 = 0 (a = 1, b = -6, c = 11, d = -6).
- Already monic, so p = -6, q = 11, r = -6.
- Depress: f = q - p²/3 = 11 - 36/3 = 11 - 12 = -1.
- g = 2p³/27 - pq/3 + r = 2(-216)/27 - (-6)(11)/3 - 6 = -16 + 22 - 6 = 0.
- Discriminant Δ = g²/4 + f³/27 = 0 + (-1)/27 = -0.037, which is negative, so three distinct real roots.
- Trigonometric form gives t = 2, 1, -1, then x = t - p/3 = t + 2.
- Roots x = 3, 2, 1.
Result: Three real roots: x = 1, x = 2, x = 3
Solve x³ - 8 = 0 (a = 1, b = 0, c = 0, d = -8).
- Monic already, p = 0, q = 0, r = -8, so the cubic is already depressed: t³ - 8 = 0.
- Here f = 0 and g = -8, so Δ = g²/4 + f³/27 = 64/4 = 16, which is positive.
- One real root: t = cbrt(-g/2 + √Δ) + cbrt(-g/2 - √Δ) = cbrt(4 + 4) + cbrt(4 - 4) = 2 + 0 = 2.
- The two complex roots have real part -(u+v)/2 = -1 and imaginary part (u-v)√3/2 = 2·1.732/2 ≈ 1.732.
Result: One real root x = 2 and two complex roots x = -1 + 1.732i and x = -1 - 1.732i
How the cubic discriminant Δ = g²/4 + f³/27 determines the roots
| Discriminant Δ | Number of real roots | Nature of the roots |
|---|---|---|
| Δ > 0 | 1 | One real root and two complex conjugate roots |
| Δ = 0 (and f = 0) | 3 | A single triple (threefold) real root |
| Δ = 0 (and f ≠ 0) | 3 | A double real root plus one distinct real root |
| Δ < 0 | 3 | Three distinct real roots |
Sample cubic equations and their roots
| Equation | Roots |
|---|---|
| x³ - 6x² + 11x - 6 = 0 | x = 1, 2, 3 |
| x³ - 3x² + 3x - 1 = 0 | x = 1 (triple root) |
| x³ - x = 0 | x = -1, 0, 1 |
| x³ - 8 = 0 | x = 2, -1 ± 1.732i |
Common mistakes to avoid
- Forgetting that a must not be zero. If a = 0 the equation is no longer cubic, it is a quadratic bx² + cx + d = 0 (or lower). This solver detects that and falls back to the quadratic, linear or constant case, but the answer is no longer a cubic with three roots.
- Expecting three real roots every time. A cubic always has at least one real root, but it can have only one. When the discriminant is positive the other two roots are complex conjugates, not real numbers.
- Mixing up the coefficient positions. Enter b as the multiplier of x² and c as the multiplier of x. Swapping them changes the equation entirely. A missing term means a coefficient of 0, so x³ - 8 needs b = 0 and c = 0.
- Reading rounded roots as exact. Roots are shown to a sensible number of decimals. An answer like 1.732 is the rounded value of √3, and values extremely close to a whole number are snapped to it, so treat the display as an approximation when the true root is irrational.
Glossary
- Cubic equation
- A polynomial equation of degree three, of the form ax³ + bx² + cx + d = 0 with a ≠ 0.
- Root
- A value of x that makes the equation equal to zero, also called a solution or zero of the polynomial.
- Discriminant
- A quantity computed from the coefficients whose sign reveals how many of the roots are real and whether any repeat.
- Depressed cubic
- The simplified form t³ + ft + g = 0 obtained by removing the x² term through the substitution x = t - p/3.
- Complex conjugate
- A pair of numbers of the form p + qi and p - qi that arise together as roots when a cubic has only one real root.
Frequently asked questions
How do I solve a cubic equation with this tool?
Enter the four coefficients a, b, c and d from ax³ + bx² + cx + d = 0. The solver normalises the equation, depresses it, evaluates the discriminant and returns up to three roots, real or complex, updating as you type.
Does every cubic equation have three roots?
Yes, counted with multiplicity. A cubic always has exactly three roots and at least one of them is real. The other two are either both real or a pair of complex conjugates, depending on the sign of the discriminant.
What does the discriminant tell me?
The sign of the discriminant Δ = g²/4 + f³/27 sets the case. Positive means one real root and two complex roots, zero means all roots are real with at least two equal, and negative means three distinct real roots.
Can it handle complex roots?
Yes. When the discriminant is positive the tool reports the single real root plus the two complex conjugate roots, each shown in the form a + bi with its real and imaginary parts.
What if a is zero?
If a is 0 the equation is not cubic. The solver automatically falls back to solving the quadratic bx² + cx + d = 0, or a linear equation if b is also 0, so you still get a valid answer.
Which method does the solver use?
It uses Cardano’s method on the depressed cubic for one-real-root and repeated-root cases, and the equivalent trigonometric (Vieta) form for three distinct real roots, which avoids cube roots of complex numbers and keeps the real answers exact.