Cubic Equation Calculator

Cubic equations have three roots, which may be three real numbers or one real and a complex pair. Enter the four coefficients to get every root and see which case applies.

How it is calculated

Enter a, b, c and d.

Read the roots.

Check the case from the discriminant.

Formula

Depressed cubic: t³ + pt + q = 0

Cardano: t = ∛(−q/2 + √Δ) + ∛(−q/2 − √Δ)

What is the Cubic Equation Calculator?

A cubic equation has the form ax³ + bx² + cx + d = 0 with a not zero. Every cubic with real coefficients has at least one real root, and altogether it has three roots counted with multiplicity. They are either three real numbers or one real number and a pair of complex conjugates. This calculator finds all of them using Cardano's method and the trigonometric method, and shows the discriminant that decides which case applies.

Cubics arise when volumes depend on a length, in the van der Waals equation for real gases, in beam deflection and in economics cost curves. In school, Class 10 and Class 11 students meet them in factor theorem questions, while engineering students solve them in numerical methods. The calculator gives exact decimal roots even when there is no neat whole-number factor.

How to calculate it by hand

1. Look for an easy root: try the factors of d divided by the factors of a, and test each with the factor theorem.

2. If x = r works, divide the cubic by (x − r) to get a quadratic, and solve it with the quadratic formula.

3. If no easy root exists, divide through by a and substitute x = t − b/(3a). This gives the depressed cubic t³ + pt + q = 0.

4. Compute Δ = (q/2)² + (p/3)³.

5. If Δ > 0, use Cardano's formula t = ∛(−q/2 + √Δ) + ∛(−q/2 − √Δ) for the one real root, then find the complex pair.

6. If Δ < 0, use the cosine form t = 2√(−p/3) cos(φ/3 − 2πk/3) for k = 0, 1, 2. If Δ = 0, there are repeated roots.

7. Convert back with x = t − b/(3a), and check with Vieta: the roots add to −b/a and multiply to −d/a.

Removing the x² term

Shifting the variable by one third of −b/a centres the cubic on its point of symmetry, its inflection point. Substituting x = t − b/(3a) makes the t² terms cancel exactly, leaving t³ + pt + q = 0 with p = c/a − b²/(3a²) and q = 2b³/(27a³) − bc/(3a²) + d/a. This depressed cubic has only two parameters, which is what makes a closed-form solution possible. Every cubic curve has the same basic S-shape, differing only in stretch, tilt and position.

Cardano's trick and the discriminant

Cardano wrote t = u + v and required 3uv = −p. Substituting turns the depressed cubic into u³ + v³ = −q with u³v³ = −p³/27, so u³ and v³ are the two roots of a quadratic. Its discriminant is Δ = (q/2)² + (p/3)³. When Δ > 0, the square root is real and the cube roots give one real root, with the other two complex. Note that many textbooks use the discriminant −4p³ − 27q², which equals −108Δ, so the signs are reversed: their positive corresponds to this calculator's negative.

Three real roots need cosines

When Δ < 0, all three roots are real, yet Cardano's formula asks for the square root of a negative number. Historically this puzzle, called the casus irreducibilis, pushed mathematicians to accept complex numbers. The practical fix is trigonometric: the identity cos 3φ = 4cos³φ − 3cos φ has the same shape as the depressed cubic, so the roots can be written as cosines. That is what the calculator uses in this case, avoiding complex arithmetic and giving all three real roots directly.

Worked example, step by step

Farhan's Class 11 worksheet asks him to solve 2x³ − 3x² − 11x + 6 = 0 and verify the sum and product of the roots using Vieta's relations.

Divide by a and substitute x = t − b/(3a): t³ + pt + q = 0 with p = -6.25, q = 0

Discriminant: Δ = (q/2)² + (p/3)³ = -9.042245 Δ < 0 → three real roots (trigonometric method)

Roots: x₁ = 3, x₂ = 0.5, x₃ = -2

Answer: Roots x₁ = 3, x₂ = 0.5, x₃ = -2; Discriminant Δ -9.042245

Common mistakes to avoid

Forgetting to divide by a before forming p and q when a is not 1.

Leaving the answer in terms of t and forgetting to subtract b/(3a).

Stopping after finding one root, when the reduced quadratic gives the other two.

Reading the sign of the discriminant with the wrong convention; check which definition your textbook uses.

Entering a = 0, which makes the equation quadratic rather than cubic.

Where it is used

Checking factor theorem and polynomial problems in Class 10 and Class 11.

Solving the van der Waals equation for molar volume in physical chemistry.

Finding dimensions of a box or tank of a given volume when sides are linked.

Locating equilibrium points and eigenvalues of 3 × 3 matrices in engineering.

Numerical methods courses that compare closed-form roots with Newton–Raphson.

Frequently asked questions

Is there a quick check for integer roots?

Try factors of d ÷ a; for x³ − 6x² + 11x − 6, x = 1 works, giving roots 1, 2 and 3.

What if a is zero?

Then it is a quadratic; use the Quadratic Equation Calculator.