Cubic Equation Calculator
Solve ax³ + bx² + cx + d = 0 — with the discriminant, the working, and a check on every root.
Put the equation in standard form first
Collect every term on the left so the equation reads ax³ + bx² + cx + d = 0, then enter the four coefficients. A missing term is a coefficient of 0, and the leading coefficient a cannot be zero.
Roots
Enter the four coefficients and solve to see all three roots.
Root x₁
--
Root x₂
--
Root x₃
--
Discriminant Δ
--
Check each root
Every root put back into the polynomial.
Log these values
- Depressed p
- --
- Depressed q
- --
- Nature of roots
- --
Step-by-step working
Notes on the method will appear here.
Factored form
--
Expanding this bracket returns the equation you entered.
What the graph does
--
Root count and curve shape always tell the same story.
How the cubic equation calculator works
A cubic equation calculator solves equations in the form ax³ + bx² + cx + d = 0, where a ≠ 0. Enter the coefficients a, b, c, and d to calculate up to three real or complex roots. The calculator applies algebraic methods to determine the values of x that satisfy the equation.
Every cubic with real coefficients has at least one real root, so the answer is never empty. The route to it is always the same: removing the x² term turns the equation into a depressed cubic in one variable, the discriminant classifies it, and the matching formula produces the three values, which are then shifted back to the original variable.
Substitute x = t − b/3a to remove the squared term.
The sign of the discriminant fixes how many roots are real.
Apply the matching formula, then undo the substitution.
The cubic formulas
Depressed cubic
t³ + pt + q = 0
With p = (3ac − b²)/3a² and q = (2b³ − 9abc + 27a²d)/27a³, reached by setting x = t − b/3a.
Discriminant
Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²
Positive gives three distinct real roots, zero gives a repeated root, negative gives one real root and a complex pair.
Three real roots — trigonometric
tₖ = 2√(−p/3)·cos[⅓·arccos(3q/(2p)·√(−3/p)) − 2πk/3]
Used when Δ > 0, where the radical form would otherwise require complex arithmetic to reach real answers.
One real root — Cardano
t = ∛(−q/2 + √(q²/4 + p³/27)) + ∛(−q/2 − √(q²/4 + p³/27))
Used when Δ < 0. The two complex roots follow from the same pair of cube roots.
Repeated-root shortcut: when Δ = 0 and p ≠ 0, the double root is t = −3q/2p and the simple root is t = 3q/p. When p and q are both zero the equation has a single triple root at x = −b/3a.
Method reference: OpenStax covers the rational zero theorem, the factor theorem, and the conjugate-pair rule this calculator relies on in Zeros of Polynomial Functions.
Case selection guide
Which case is your cubic in?
The discriminant answers the question before any root is computed, and each case has a matching picture on the graph. Reading the sign first tells you whether to expect decimals, a repeated value, or a complex pair.
| Discriminant | Roots | On the graph | Method used |
|---|---|---|---|
| Δ > 0 | Three distinct real roots | Crosses the x-axis three times | Trigonometric form, which avoids complex intermediates. |
| Δ = 0, p ≠ 0 | A double root and a simple root | Touches the axis once, crosses once | Direct formulas from p and q; no radicals needed. |
| Δ = 0, p = 0 | One triple root | Flattens onto the axis at a single point | Read straight off as x = −b/3a. |
| Δ < 0 | One real root, two complex conjugates | Crosses the axis exactly once | Cardano's formula with real cube roots. |
If you are working by hand: try the rational root theorem before any of this. One rational root reduces the cubic to a quadratic, and the quadratic formula finishes the job in a single line.
Worked examples
Cubic equation examples with roots
Each row is one of the presets above. Load it in the calculator to see the discriminant, the depressed cubic, and the full working behind the answer.
| Equation | Δ | Case | Roots |
|---|---|---|---|
| x³ − 6x² + 11x − 6 = 0 | 4 | Three real, distinct | 1, 2, 3 |
| x³ − 3x + 1 = 0 | 81 | Three real, irrational | −1.879385, 0.347296, 1.532089 |
| x³ − 3x + 2 = 0 | 0 | Double root and simple root | 1 (twice), −2 |
| x³ + x + 1 = 0 | −31 | One real, complex pair | −0.682328, 0.341164 ± 1.161541i |
Faster by hand
What to try before the cubic formula
The general formula is the last resort, not the first move. Three cheap checks solve most textbook cubics in a fraction of the time, and they leave working that is far easier to mark.
1. Look for a common factor
If d = 0, then x is a factor and one root is 0 immediately, leaving a quadratic behind.
2. Test the rational candidates
Any rational root is a divisor of d over a divisor of a. For integer coefficients that is a short list worth testing.
3. Divide out the factor you find
Synthetic division by (x − r) leaves a quadratic, and the quadratic formula finishes the remaining two roots.
Standard form matters: the calculator reads coefficients, not equations. 4x³ + 2x = 3x² − 9 must be collected into 4x³ − 3x² + 2x + 9 = 0 before entry, and any term that is missing is entered as 0 rather than skipped.
Historical reference: MacTutor traces the general solution of the cubic, and the priority dispute behind it, in Quadratic, cubic and quartic equations.
Reading the discriminant
One number decides the shape of the answer
The discriminant is built from the coefficients alone, so it is available before any root is found. Its sign tells you what kind of answer to expect — and, just as usefully, what a wrong-looking answer should have been.
Δ is positive
Three separate real roots. The curve has two turning points and passes through the axis between them.
Δ is zero
At least two roots have collided. The graph touches the axis without crossing at the repeated value.
Δ is negative
One real root and a conjugate pair. Two complex answers are correct here, not a sign of an error.
Interesting fact
Cubics are why complex numbers exist
Complex numbers did not arrive through quadratics. A quadratic with no real solution could simply be declared unsolvable and set aside. Cubics offered no such escape: when all three roots are plainly real, Cardano's formula still routes through square roots of negative numbers to reach them. Rafael Bombelli worked out in the 1570s how to handle those impossible quantities so that they cancelled at the end, leaving the real answers everyone could already see. Mathematicians had to accept the imaginary in order to keep the real — the awkward case still known as casus irreducibilis, and the reason this calculator switches to a trigonometric formula when the discriminant is positive.
Source: MacTutor History of Mathematics, Rafael Bombelli.
Showing your work
What to record alongside the roots
A list of three decimals is hard to check and easy to mistype. Recording how you got there makes an error traceable and usually carries most of the marks.
Minimum working to show
- The equation in standard form, with all four coefficients
- Any factor found by inspection, and the division that follows
- The discriminant, or the quadratic you reduced to
- Each root substituted back, with the residual you got
When a root needs interpreting
Cubics from real models — volumes, break-even points, beam deflections, chemical equilibria — often admit only one meaningful root. A negative length or a concentration above the total available is mathematically valid and physically meaningless, so state which root you keep and why before using it.
Example line: x³ − 6x² + 11x − 6 = 0 · try x = 1 → 0, so (x − 1) is a factor · divide → x² − 5x + 6 · factor → (x − 2)(x − 3) · roots 1, 2, 3 · check: each gives 0 ✓.
Common mistakes to avoid
Skipping a missing term. In x³ − 8 = 0 the coefficients are 1, 0, 0, −8. Leaving b and c out shifts every later value.
Stopping at one root. A cubic has three. Finding the obvious one and moving on loses the other two, real or complex.
Rounding before dividing. Using a rounded root in the synthetic division corrupts the quadratic and both remaining answers with it.
Reading Δ = 0 as an error. A repeated root is a legitimate answer; the curve touches the axis there rather than crossing it.
Frequently Asked Questions
What is a cubic equation, and what does a cubic equation calculator do?
A cubic equation is a polynomial equation of degree three, written in standard form as ax³ + bx² + cx + d = 0 with a leading coefficient a that is not zero. The highest exponent on the variable is 3, which is what makes the expression a cubic polynomial rather than a quadratic one. A cubic equation calculator takes those four coefficients and returns the three roots of the polynomial, real or complex, together with the discriminant that classifies them. Because the degree is three, there are always exactly three roots when repeated ones are counted with their multiplicity.
How do you solve x³ − 6x² + 11x − 6 = 0 by hand?
Start with the rational root theorem: any rational root divides the constant term 6, so test ±1, ±2, ±3 and ±6. Substituting x = 1 gives 1 − 6 + 11 − 6 = 0, so x = 1 is a root and (x − 1) is a factor. Dividing the polynomial by that factor leaves the quadratic equation x² − 5x + 6 = 0, which factors as (x − 2)(x − 3). The solution set is x = 1, 2 and 3, and the complete factorization is (x − 1)(x − 2)(x − 3) = 0 — a few lines of algebra that beat any general formula for speed.
What does the discriminant of a cubic equation tell you?
The discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² sorts the roots into three cases without solving anything. A positive discriminant means three distinct real roots, so the cubic function has three x-intercepts and two turning points, which the derivative locates. A negative value means one real root and a conjugate pair of complex roots, and the graph crosses the axis once. A discriminant of exactly zero means a repeated root, where the curve touches the axis instead of cutting through it.
Can a cubic equation have no real roots?
No. Every cubic with real coefficients has at least one real root, because the graph of the function runs from negative infinity to positive infinity and must cross the x-axis somewhere along the way. Complex roots of a real polynomial always arrive in conjugate pairs, so an imaginary number never turns up alone in the answer and a cubic can carry two of them at most. That is why the possible outcomes are three real roots, or one real root plus a pair of complex numbers, and never zero real roots.
When should you use the rational root theorem instead of the cubic formula?
Use the rational root theorem first whenever the coefficients are integers, since testing the divisors of the constant term over the divisors of the leading coefficient is far quicker than the general formula. One rational root reduces the cubic to a quadratic, which the quadratic formula finishes in a line. Reach for Cardano's method only when no rational root exists: his formula opens with a substitution that strips out the x² term to leave a depressed cubic, then extracts the answer from nested radicals. That is the situation for most equations with irrational answers.
Why are the roots shown as decimals instead of exact radicals?
Exact radical forms for a cubic are often far less readable than the decimal values they represent, and in the three-real-root case they cannot be written without complex numbers at all — a historical oddity known as casus irreducibilis. This calculator reports an exact integer or fraction whenever a root has one, and falls back to a rounded approximation at your chosen precision otherwise. The residuals in the check panel show how close each calculation sits to a true zero of the polynomial.
Before you submit the answer
- The equation is collected into ax³ + bx² + cx + d = 0
- Missing terms were entered as 0, not skipped
- All three roots are reported, not just the obvious one
- Repeated roots are stated with their multiplicity
- Complex roots are written as a conjugate pair
- Each root was substituted back into the original equation
Other useful calculators
Stride Length Calculator
Find your step length and turn step counts into distance.
Marathon Pace Calculator
Plan splits and finish times for your target marathon pace.
Bike Gear Calculator
Compare gear ratios, development, and cadence versus speed.
Batting Average Calculator
Work out batting average from hits and official at-bats.
Meeting Cost Calculator
Price the labor and annual cost of a recurring meeting.
Winch Size Calculator
Size a winch from vehicle weight and pulling conditions.
Disclaimer
This calculator solves cubic equations with real coefficients in standard form. Equations of a different degree, or with complex coefficients, variables in a denominator, or terms under a root, are outside its scope.
Roots are computed in floating-point arithmetic and are accurate to the precision shown, not to infinite precision. Coefficients that differ by many orders of magnitude, or discriminants extremely close to zero, can make the classification between a repeated root and two nearly equal roots sensitive; the residuals in the check panel indicate how much to trust a given answer.
The working shown is one valid route to the solution. Where a class, textbook, or marking scheme prescribes factoring, synthetic division, or a particular formula, follow that convention rather than this one.
Last updated
Formulas, worked examples, and references checked on this date.