Cubic Equation
solver.
Every cubic has three roots, real or complex, and the curve shows you the real ones.
- Discriminant Δ
- 4
- Inflection point
- (2, 0)
- Largest leftover
- Under 10⁻¹²
The curve crosses the x-axis at three different points, because the discriminant is above 0.
The curve and its roots
Drag the point up or down to change dThe curve crosses the x-axis at 1, 2, 3, and turns at x = 1.42 and 2.58. It changes its bend at x = 2.
Each root
| Root | Value | Type |
|---|---|---|
| x₁Real | 1 | Real |
| x₂Real | 2 | Real |
| x₃Real | 3 | Real |
What if d changes
| d | Roots | Kind |
|---|---|---|
| −21One real | 4.6, 0.7 ± 2.02i | One real |
| −16One real | 4.31, 0.85 ± 1.73i | One real |
| −11One real | 3.9, 1.05 ± 1.31i | One real |
| −6(yours)Three real | 1, 2, 3 | Three real |
| −1One real | 0.1, 2.95 ± 1.31i | One real |
| 4One real | −0.31, 3.15 ± 1.73i | One real |
| 9One real | −0.6, 3.3 ± 2.02i | One real |
Steps of 5. The kind of root changes between d = −11 and d = −6, because the curve moves past a turning point.
Working
- 1Read off the numbersa = 1, b = −6, c = 11, d = −6
- 2Discriminant, which sorts the rootsΔ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²= 4
- 3Move the curve so the x² term goes awayx = t − b3a = t + 2
- 4That leaves t³ + pt + q = 0p = 3ac − b²3a² = −1q = 2b³ − 9abc + 27a²d27a³ = 0
- 5Δ is above 0: three real roots, by cosinesm = 2√(−p3) = 1.1547cos 3θ = 3qpm = 0
- 6Take m cos θ at three angles a third of a turn apart, then shift backx = 1, x = 2, x = 3
- 7Check: put each root back, and add and multiply themAt x = 1, the cubic is about 0At x = 2, the cubic is about 0At x = 3, the cubic is about 0Sum 6 = −ba = 6Product 6 = −da = 6
How it's worked out
The method first moves the curve sideways so the term vanishes. The substitution leaves a simpler cubic in t, called the depressed cubic, with two numbers that carry all the shape.
A single number then says which kind of roots you have. It is the discriminant, written Δ.
The sign of Δ sorts the cases. Above 0, there are three different real roots. At 0, all are real and at least two match. Below 0, there is one real root and a complex pair.
Each case has its own route. With three real roots, this tool uses cosines and avoids complex numbers on the way. With one real root, Cardano's formula takes cube roots of two real numbers, and dividing out that root leaves a quadratic for the pair. Each real root is then refined with a few steps of Newton's method.
Exact forms use the rational zero theorem: with whole coefficients, any fraction root has a top dividing d and a bottom dividing a. When one exists, dividing it out leaves a quadratic that can be solved exactly.
Worked examples
Ines tries a puzzle from the 1500s
Ines is reading about . MacTutor's history says Cardano's formula led to the square root of −121 here, though x = 4 was known to work. Moved to one side, Δ is 13,068, so all three roots should be real.
The roots are 4 and , or about −3.7321, −0.2679, 4. Bombelli later showed that working through the complex numbers in such a formula still leads to correct real answers.
Ben finds the complex pair of a cubic
Ben's worksheet has . Trying the factors of 20, he finds x = 2 works. Δ is −11,664, so the other two roots cannot be real.
Dividing out that root leaves a quadratic, which gives −1 + 3i and −1 − 3i. As a check, the three roots multiply to 20 and add to 0, which match and . The factored form is (x − 2)(x² + 2x + 10).
Rosa sizes an open box from a sheet
Rosa cuts squares of side x from the corners of a 10 by 12 sheet and folds up the sides. The volume is , which is . She wants a volume of 48, so she needs .
The roots are about 0.48, 3.61, 6.91. A cut has to be above 0 and less than half the short side, so only 0.48 and 3.61 give a real box. The root at 6.91 is correct as algebra but cuts past the middle of the sheet.
Reading your result
A cubic crosses the axis at least once. With real coefficients, one end of the curve goes up and the other goes down. Complex roots come in conjugate pairs, so the count of real roots is one or three, with repeats counted.
A double root looks like a touch. The curve meets the axis and turns back without crossing. For , the roots are −1 and 2, with 2 counted twice. That graph has a low point sitting right on the axis.
Turning points come from the slope. They sit where . When is below 0 there are none, and the curve only climbs or only falls. The curve changes its bend at , and it is symmetric about that point.
Calculations carry about 15 significant digits. Roots very close together are sensitive, as a near-double pair can only be pinned down to about half of those digits. Coefficients above are rejected, since cubing them would overflow.
| Cubic | Δ | Roots |
|---|---|---|
| x³ − 8 | −1,728 | 2, −1 + 1.732i, −1 − 1.732i |
| x³ − 3x² + 3x − 1 | 0 | 1 (×3) |
| x³ − 7x + 6 | 400 | −3, 1, 2 |
| x³ + x² + x + 1 | −16 | −1, i, −i |
Common mistakes
- Stopping at the first root. A root you can guess is only a start. Divide it out, then solve the quadratic that remains, or the complex pair goes missing.
- Reading a double root as two different roots. (x − 1)(x − 2)(x − 3) has three separate factors, while a squared factor counts one root twice. The table of roots shows which is which.
- Thinking the sum check proves everything. For x³ − 6x² + 11x − 6 the roots add to 6, which matches, but three wrong numbers can share that sum. Put each root back as well.
- Leaving a at 0. Without the term, the equation is a quadratic, and these formulas divide by a. The quadratic solver is the right tool for it.
Questions people ask
Sources
- NIST Digital Library of Mathematical Functions, section 1.11, Zeros of Polynomials
- Wolfram MathWorld, Polynomial Discriminant
- Wolfram MathWorld, Cubic Formula
- Abramson, College Algebra 2e, OpenStax, section 5.5, Zeros of Polynomial Functions
- MacTutor, Quadratic, cubic and quartic equations
- MacTutor, Rafael Bombelli