Solving a Cubic Polynomial

PDF Version

This is a general cubic polynomial equation:

ax3 + bx2 + cx + d = 0,      a ≠ 0.

Instead of directly tackling the polynomial in this form, first consider a "smaller" form, then work backwards to show how it can be applied to the general form. This smaller form is

x3 = Ax + B.

It is missing the x2 term. This is a depressed cubic. Any general cubic polynomial can be depressed by a horizontal shift of the input variable, which will be discussed later.

Assume the solution of the depressed form is

x = m + n.

Cube both sides and expand:

x3 = (m + n)3 = m3 + 3m2n + 3mn2 + n3.

Rearrange terms slightly:

x3 = m3 + n3 + 3mn(m + n).

Since x = m + n, the equation is now

x3 = m3 + n3 + 3mnx.

This is equivalent to the form x3 = Ax + B, where A = 3mn and B = m3 + n3.

Example: Solve x3 = x + 1.

Solution: Set 3mn = 1 and m3 + n3 = 1.

In the first equation, isolate n and substitute into the second equation:

n = 1/(3m)       →       m3 + (1/(3m))3 = 1.

Simplify the second equation by clearing fractions and collecting terms to one side:

m3 + 1/(27m3) = 1

27m6 + 1 = 27m3

27m6 − 27m3 + 1 = 0.

Solve the last equation using the quadratic equation, where m6 = (m3)2:

Thus,

Since n = 1/(3m),

Lastly, since x = m + n, the solution to the equation x3 = x + 1 is

Using the positive radical gives:

A calculator shows that this is x = 1.324717957... .


Graph of f(x) = x3x − 1 with root highlighted.

Note that the negative radical form gives the same result:

If C is a root of the equation x3AxB = 0, then the cubic expression can be factored as

The quadratic formula gives the two other roots:

In this example, the other two roots are x = −0.6623589785 ± 0.5622795116i, both Complex.

In general, by setting 3mn = A and m3 + n3 = B, the general form can be found, as follows:

Solve for n in the first equation:

n = A/(3m).

Substitute into the second equation, and simplify by clearing fractions and collecting terms to one side:

m3 + (A/(3m))3 = B

m3 + A3/(27m3 ) = B

27m6 − 27Bm3 + A3 = 0.

Using the quadratic formula gives

Thus,

Since n = A/(3m), this gives

The general solution is

As shown in the first example, either form with the positive or negative radicals gives the same result.

Simplified, the above form is


Example: Solve x3 = 2x + 3.

Solution: Note that A = 2 and B = 3. Thus,

On a calculator, this is x = 1.893289196 ...   .


Graph of f(x) = x3 − 2x − 3 with root highlighted.

Example: Solve x3 = −x + 2.

Solution: Note that A = −1 and B = 2. By inspection, x = 1 is a solution. Will this method work? Substituting gives

On a calculator, this is x = 1. It worked. However, it is not obvious this long expression is 1 in disguise. This illustrates a problem with this method. It returns valid results, but in a form that can be hard to decipher. There is no easy way to simplify this expression.

Example: Solve x3 = 7x + 3.

Solution: Note that A = 7 and B = 3. Substituting gives

The radicand is negative, but interestingly, using a calculator gives x = 2.838469252 + 0i. The answer is Real, with no imaginary part.


Graph of f(x) = x3 − 7x − 3 with root highlighted.

Observe that this method gives the largest possible Real solution. Suppose the graph is reflected across the y-axis. This is done by substituting −x for x, and simplifying. The equation x3 = 7x + 3, after substitution, becomes (−x)3 = 7(−x) + 3, which is −x3 = −7x + 3, or x3 = 7x − 3. This is the same graph as the above but shifted up 6 units. Its roots will be negative of the three roots of the above graph.

Using the formula, only one small change happens: B = −3:

A calculator gives x = 2.397661541 + 0i. Thus, another root of the original equation is the negation, x = −2.397661541.


Graph of f(x) = x3 − 7x − 3 with another root highlighted.


Referring to the formula for x,

The formula always gives a Real result, even in cases when the radicand 81B2 − 12A3 is negative. When the radicand is positive, the graph of f(x) = x3AxB crosses the x-axis once, and has exactly one Real solution, the other two being Complex conjugate roots. When the radicand is zero or negative, the graph of f touches the x-axis twice (one root a repeated root) or three times (three Real roots).

Forcing the radicand to be positive gives

81B2 − 12A3 > 0.

This is equivalent to

A3/B2 < 27/4.

Note that 81/12 = 27/4 after simplification.

What does this actually mean? Is there a visual way to justify this? There is.

The graph below shows the basic cubic function y = x3 with a generic linear graph y = Ax + B. Note that A is the slope of the line.

In this configuration, the graphs intersect once. Thus, the function f(x) = x3AxB will have one Real root and two Complex conjugate roots, and the radicand in the formula will be positive.

Suppose the linear graph moves downward, as shown below:

In this configuration, the graphs intersect three times. The function f(x) = x3AxB will have three Real roots, each of multiplicity 1 (that is, all unique). But more importantly, the radicand in the formula will be negative.

It is the B value that governs the line's y-axis intercept. Assume that A (the slope) is kept constant. Now find bounds for B that will ensure the radicand is positive and that the function f(x) = x3AxB has exactly one Real root. It is known that this happens when A3/B2 < 27/4.

Below, the graphs of the line y = Ax + B touch tangentially to the graph of y = x3 (the two black points). Where these lines cross the y-axis (the orange points) form an interval. If B is within this interval, then the radicand in the formula is negative and function f(x) = x3AxB has three unique Real roots. If B is outside this interval, then the radicand is positive and the function f(x) = x3AxB has exactly one Real root.

The derivative of y = x3 is y′ = 3x2. Now find the x-values for which the slope of the tangent line is A; that is, solve

3x2 = A.

This gives

x = ± (A/3)1/2.

Consider the case for which x = (A/3)1/2. The coordinate on the graph y = x3 is ((A/3)1/2, (A/3)3/2). The line has slope A, so using the point-slope formula for a line, yy1 = m(xx1), and substituting gives

Distribute and isolate y:

The two constant terms can be simplified:

Thus, the equation of the tangent line is

The value y = −2(A/3)3/2 is the y-intercept of the lower of the two lines. By symmetry, the value y = 2(A/3)3/2 is the y-intercept of the upper of the two lines. This results in two statements:

  • If −2(A/3)3/2 < B < 2(A/3)3/2, then the graphs cross three times, the radicand in the formula is negative, and the function f(x) = x3AxB has three unique Real roots.
  • If B < −2(A/3)3/2 or B > 2(A/3)3/2, then the graphs cross once, the radicand in the formula is positive, and the function f(x) = x3AxB has one Real root.

Consider the inequality B > 2(A/3)3/2. It can be rearranged slightly. Divide by 2:

B/2 > (A/3)3/2.

Square both sides:

(B/2)2 > (A/3)3.

Clear parentheses:

B2/4 > A3/27.

Divide through by B2 and A3, and rearrange:

A3/B2 < 27/4.

This was the same inequality derived from the radicand directly. Note that using any of the other expressions above will result in this same inequality.

Lastly, note that if A is negative, then the above inequality is always true and there will only be a single Real root.


Consider the case when the radicand is 0:

Example: Solve x3 = 3x + 2.

Solution: Note that A = 3 and B = 2. Substituting gives

This is just 1 + 1 = 2, which is a solution that can be easily checked.


Graph of f(x) = x3 − 3x − 2 with the root at 2 highlighted.

The expression x3 − 3x − 2 factors as (x − 2)(x + 1)2, so that x = −1 is the other root, with multiplicity 2.


The General Cubic Case

The general cubic equation is given by

ax3 + bx2 + cx + d = 0,       a ≠ 0.

The leading coefficient can always be divided out, resulting in a simpler form,

x3 + bx2 + cx + d = 0.

Out of laziness, b/a is renamed b, c/a is renamed c and d/a is renamed d in the above equation. There is never any reason to not divide out the leading coefficient first.

The quadratic term can be removed by a horizontal shift. Let x = w + h, where h is the shift to be determined. Substituting,

(w + h)3 + b(w + h)2 + c(w + h) + d = 0.

Expanded, this is:

w3 + 3w2h + 3wh2 + h3 + bw2 + 2bwh + bh2 + cw + ch + d = 0.

The terms are recollected in powers of w:

w3 + w2 (3h + b) + w(3h2 + 2bh + c) + (h3 + bh2 + ch + d) = 0.

To remove the quadratic term (w2), force 3h + b = 0, which means that h = −b/3.

Thus, to depress a cubic equation of the form x3 + bx2 + cx + d = 0, set x = wb/3.


Example: Find the Real root of x3 + 6x2 − 7x + 10 = 0.

Solution: Here, b = 6, so h = −6/3 = −2.

Substituting this into the expanded form above, and noting that c = −7 and d = 10, results in:

w3 + w2 (3(−2) + (6)) + w(3(−2)2 + 2(6)(−2) + (−7)) + ((−2)3 + (6)(−2)2 + (−7)(−2) + (10)) = 0,

Which gives

w3 + 0w2 − 19w + 40 = 0.

This is now a depressed cubic:

w3 − 19w + 40 = 0.

The graph of the depressed cubic y = w3 − 19w + 40 is the graph of the original, y = x3 + 6x2 − 7x + 10, shifted to the right by 2 units.

Now solve w3 − 19w + 40 = 0 by writing it as w3 = 19w − 40 and using the formula. Here, A = 19 and B = −40:

This is w = −5.170679557.

The original substitution was x = w − 2, so that x = −5.170679557 − 2 = −7.170679557. This is the lone Real root of the original cubic equation.


Graph of f(x) = x3 + 6x2 − 7x + 10 with the Real root highlighted.

 

 

 

By Scott Surgent. Please send feedback or error notification to me at scott dot surgent at gmail. Updated 8/10/26.