Cubic Equation Calculator
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free cubic equation calculator. Enter a, b, c and d to find every real and complex root of a cubic equation, with the discriminant and a check.
- Roots
- 0
- Discriminant
- 0
- Complex roots
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the cubic equation calculator
- Write your equation in the standard form ax³ + bx² + cx + d = 0. Move every term to one side so the other side is zero.
- Enter the coefficients a, b, c and d. Use 0 for any missing term and negative numbers where needed.
- Read the roots as you type.
The cubic equation calculator shows all the real roots, the complex roots if there are any, what kind of roots the equation has, and the discriminant. If a is 0, it solves the resulting quadratic or linear equation instead.
What is a cubic equation?
A cubic equation is a polynomial equation where the highest power of x is 3:
ax³ + bx² + cx + d = 0, with a ≠ 0.
Every cubic equation has exactly three roots, counted with multiplicity, though some may be complex numbers. Because complex roots of equations with real coefficients come in conjugate pairs, a cubic always has at least one real root. So there are three possibilities:
- Three distinct real roots.
- A repeated real root: either one root repeated twice plus another, or one root repeated three times.
- One real root and two complex conjugate roots.
For example, x³ − 6x² + 11x − 6 = 0 has roots 1, 2 and 3, because it factors as (x − 1)(x − 2)(x − 3) = 0.
The discriminant
The discriminant tells you which kind of roots a cubic has, before you solve it:
Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²
- Δ > 0: three distinct real roots.
- Δ = 0: a repeated root, and all roots are real.
- Δ < 0: one real root and two complex conjugate roots.
For x³ − 6x² + 11x − 6, Δ = 4, so there are three distinct real roots. For x³ − 8 = 0, Δ = −1,728, so there's one real root (2) and two complex roots (−1 ± 1.732i).
How the cubic equation calculator solves it
Mathematicians in 16th-century Italy, including Scipione del Ferro, Niccolò Tartaglia and Gerolamo Cardano, found a general formula for cubic equations. The cubic equation calculator follows the same approach:
- Divide by a and substitute x = t − b ÷ (3a). This removes the x² term, leaving a "depressed cubic" t³ + pt + q = 0.
- If there's one real root, use Cardano's formula with cube roots.
- If there are three real roots, Cardano's formula needs complex numbers even though the answers are real, so the calculator uses the trigonometric method instead, which works directly with cosines.
- Polish each root with a few steps of Newton's method, which improves accuracy, and clean up tiny rounding errors.
Rational root theorem: solving by hand
If the coefficients are whole numbers, any rational root must be a fraction p/q, where p divides d and q divides a. For x³ − 6x² + 11x − 6, the candidates are ±1, ±2, ±3 and ±6. Trying x = 1 gives 1 − 6 + 11 − 6 = 0, so x = 1 is a root. Dividing by (x − 1) leaves x² − 5x + 6, which factors as (x − 2)(x − 3). This method only finds rational roots, so for equations with irrational or complex roots, use the cubic equation calculator.
A worked example
Solve 2x³ − 3x² − 11x + 6 = 0.
- Coefficients: a = 2, b = −3, c = −11, d = 6.
- Candidates from the rational root theorem: ±1, ±2, ±3, ±6, ±1/2, ±3/2.
- Try x = 3: 54 − 27 − 33 + 6 = 0, so x = 3 is a root.
- Divide by (x − 3): 2x² + 3x − 2 = (2x − 1)(x + 2).
- Roots: x = −2, x = 0.5 and x = 3.
Enter 2, −3, −11 and 6 in the cubic equation calculator to see the same three roots.
Where cubic equations come up
- Geometry: finding the side of a box with a given volume when its dimensions are related, such as a box made by cutting squares from the corners of a sheet.
- Physics and engineering: equations of state for gases, beam bending and some motion problems.
- Economics: cost and revenue curves are sometimes modelled with cubic functions.
- Chemistry: equilibrium calculations can lead to cubic equations.
- Computer graphics: finding where a ray meets a cubic curve.
Who uses a cubic equation calculator
Students use it to check algebra homework and see all the roots, including complex ones. Teachers use it to create and check exercises. Engineers and scientists use it for quick solutions when a problem reduces to a cubic.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.
Checking your roots
You can check any root by substituting it back into the equation: the result should be zero, or extremely close to zero allowing for rounding. Another check uses Vieta's formulas, which relate the roots to the coefficients. For roots r₁, r₂ and r₃:
- r₁ + r₂ + r₃ = −b ÷ a
- r₁r₂ + r₁r₃ + r₂r₃ = c ÷ a
- r₁ × r₂ × r₃ = −d ÷ a
In the worked example, −2 + 0.5 + 3 = 1.5 = 3 ÷ 2, and (−2)(0.5)(3) = −3 = −6 ÷ 2. Both checks pass.
The graph of a cubic
The graph of y = ax³ + bx² + cx + d is an S-shaped curve. When a is positive, it rises from bottom left to top right; when a is negative, it falls. The real roots are where the curve crosses the x-axis. A cubic can have up to two turning points; if it has two, and they lie on opposite sides of the x-axis, there are three real roots. If both turning points are on the same side, or there are none, there's only one real root.
Quadratics and linear equations
If you enter a = 0, the equation isn't cubic any more, and the cubic equation calculator solves it as a quadratic (bx² + cx + d = 0) or, if b is also 0, as a linear equation. For quadratics, the quadratic formula calculator shows the full working.
Common mistakes
- Not rearranging to equal zero before entering coefficients.
- Missing terms: enter 0 for any power of x that doesn't appear.
- Sign errors, especially with negative coefficients.
- Rounding too early when checking roots by hand.
The box problem
A classic cubic problem: a square sheet of card 30 cm wide has a square of side x cut from each corner, and the sides are folded up to make an open box. The volume is V = x(30 − 2x)². If you want a volume of 1,000 cm³, you need to solve x(30 − 2x)² = 1,000. Expanding gives 4x³ − 120x² + 900x − 1,000 = 0. Entering a = 4, b = −120, c = 900 and d = −1,000 in the cubic equation calculator gives three real roots: about 1.34, exactly 10, and about 18.66. Only the first two make sense, because x must be less than 15 for the box to exist. You can check x = 10 by hand: 10 × (30 − 20)² = 10 × 100 = 1,000. So there are two ways to cut the card that give exactly 1,000 cm³. Problems like this show why it's useful to see every root, then decide which ones fit the real situation.
A short history
The search for a cubic formula is one of the great stories in mathematics. Scipione del Ferro found a method for some cubics in the early 1500s but kept it secret. Niccolò Tartaglia rediscovered it and won a public problem-solving contest with it in 1535. He later shared it with Gerolamo Cardano on condition of secrecy, but Cardano published it in his 1545 book Ars Magna after learning of del Ferro's earlier work, which caused a famous dispute. Working with these formulas pushed mathematicians to take complex numbers seriously, because the formula sometimes needs square roots of negative numbers even when all three roots are real. The trigonometric method used by the cubic equation calculator for that case was developed later, by François Viète.
Quartic and higher equations
Cardano's student Lodovico Ferrari found a formula for quartic equations, with a power of 4. For equations of degree 5 and higher, the Abel–Ruffini theorem, proved in the 1800s, shows there's no general formula using only arithmetic and roots. Those equations are solved numerically instead.
Sources and further reading
- Cubic equation on Wikipedia: Cardano's formula, the trigonometric method and the discriminant.
- Rational root theorem on Wikipedia: finding rational roots by hand.
- Vieta's formulas on Wikipedia: relationships between roots and coefficients.
Frequently asked questions
How do you solve a cubic equation?
Use the rational root theorem to find a root by hand, then factor; or use Cardano's formula or the trigonometric method. The cubic equation calculator does it automatically.
How many roots does a cubic have?
Three, counted with multiplicity. At least one is always real.
What does the discriminant tell me?
Positive: three distinct real roots. Zero: a repeated root. Negative: one real and two complex roots.
Can a cubic have no real roots?
No. Every cubic with real coefficients has at least one real root.
What if a = 0?
The equation is quadratic or linear, and the calculator solves it that way.
Is the cubic equation calculator free?
Yes. It's free, needs no sign-up, and works in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.