Cubic and Quartic Equations

Dr. Math FAQ || Classic Problems || Formulas || Search Dr. Math || Dr. Math Home

#### Cubic Equations

Let's say you have the equation ax3 + bx2 + cx + d = 0. The first thing to do is to get rid of the "a" out in front by dividing the whole equation by it. Then we get something in the form of x3 + ex2 + fx + g = 0. The next thing we do is to get rid of the x2 term by replacing x with (y - e/3). The new equation y3 + py + q = 0 has no y2 term. This is much easier to solve, although it's still kind of hard and it took a lot of really smart people a long time to do.

Let's introduce two new variables, t and u, defined by the equations

```             u - t = q               and
tu = (p/3)3.

```
If you're really interested, you might want to know what t and u actually are in terms of p and q:
```         -3qSqrt{3} +- Sqrt{4p3 + 27 q2}
t = ---------------------------------
6 Sqrt{3}

3qSqrt{3} +- Sqrt{4p3 + 27q2}
u =  --------------------------------
6 Sqrt{3}

```
That +- is either + or - for BOTH of the equations at the same time. You can't have one as a + and the other as a - .

Anyway, y1 = CubeRoot{t} - CubeRoot{u} will be a solution of y3 + py + q = 0.

Verify this result now (DON'T use the explicit formulas for t and u, just plug CubeRoot{t} - CubeRoot{u} into the cubic polynomial), and make sure you see why it works. To find the other two solutions of our cubic polynomial (if there are any real ones) we could divide y3 + py + q by its known factor (y - CubeRoot{t} + CubeRoot{u}), getting a quadratic equation that we could solve by the quadratic formula. Finally, once we have the solution values of y, we can find x = y - e/3.

As you can see, the complexity is much greater than in the Quadratic Formula. To try to go backward and come up with a closed form for the Cubic Formula in terms of the original a, b, c, d would be a real pain.

For a nice reference about this problem, as well as some information about the Quartic, look at the 3-volume set called Mathematical Thought from Ancient to Modern Times by Morris Kline. It gives the math and the history together.

For more about solving cubic polynomial equations, see Another Solution of the Cubic Equation, which describes an approach (submitted independently by Paul A. Torres and Robert A. Warren) based on "completing the cube."

Quartic Equations - by Robert L. Ward, for the Math Forum

#### Simplifying the equation

There are several ways to solve quartic equations. They all start by dividing the equation by the leading coefficient, to make it of the form

x4 + a x3 + b x2 + c x + d = 0.

There is an easy special case if d = 0, in which case you can factor the quartic into x times a cubic. The roots then are 0 and the roots of that cubic. (To solve the cubic equation, see above.)

Substitute x = y - a/4, expand, and simplify, to get

y4 + e y2 + f y + g = 0

where

e = b - 3 a2/8,
f = c + a3/8 - a b/2,
g = d - 3 a4/256 + a2 b/16 - a c/4.

At this point, there are two useful special cases.

1. If g = 0, then, again, you can factor the quartic into y times a cubic. The roots of the original equation are then x = -a/4 and the roots of that cubic with a/4 subtracted from each.

2. If f = 0, then the quartic in y is actually a quadratic equation in the variable y2. Solve this using your favorite method, and then take the two square roots of each of the solutions for y2 to find the four values of y which work. Subtract a/4 from each to get the four roots x.

Henceforth we can assume that d, f, and g are all nonzero.

#### First Solution Method

Here is one way to proceed from this point. The related auxiliary cubic equation

z3 + (e/2) z2 + ((e2-4 g)/16) z - f2/64 = 0

has three roots. Find those roots by solving this cubic (again, see above). None of these is zero because f isn't zero. Let p and q be the square roots of two of those roots (any choices of roots and signs will work), and set

r = -f/(8 p q).

Then p2, q2, and r2 are the three roots of the above cubic. More important is the fact that the four roots of the original quartic are

x = p + q + r - a/4,
x = p - q - r - a/4,
x = -p + q - r - a/4, and
x = -p - q + r - a/4.

This solution was discovered by Leonhard Euler (1707-1783).

#### Second Solution Method

Here is another way to proceed from the above point. The quartic in y must factor into two quadratics with real coefficients, since any complex roots must occur in conjugate pairs. Write

y4 + e y2 + f y + g = (y2 + h y + j) (y2 - h y + g/j)

Since f and g aren't zero, neither j nor h is zero either. Without loss of generality, we can assume h > 0 (otherwise swap the two factors). Then, equating coefficients of y2 and y,

e = g/j + j - h2,
f = h (g/j - j).

so

g/j + j = e + h2,
g/j - j = f/h.

Adding and subtracting these two equations,

2 g/j = e + h2 + f/h,
2 j = e + h2 - f/h.

Multiplying these together,

4 g = e2 + 2 e h2 + h4 - f2/h2.

Rearranging,

h6 + 2 e h4 + (e2-4 g) h2 - f2 = 0.

This is a cubic equation in h2, with known coefficients, since we know e, f, and g. We can use the solution for cubic equations shown above to find a positive real value of h2, whose existence is guaranteed by Descartes' Rule of Signs, and then take its positive square root. This value of h will give a value of j from 2 j = e + h2 - f/h. Once you know h and j, you know the quadratic factors of the quartic in y. Notice that you do not need all the roots h2 of the cubic, and that any positive real one will do. Further notice that h2 = 4 z from the previous section.

Once you have factored the quartic into two quadratics, finishing the finding of the roots is simple, using the Quadratic Formula. Once the roots y are found, the corresponding x's are gotten from x = y - a/4.

#### Examples

Example 1: Find the roots of x4 + 6 x3 - 5 x2 - 10 x - 3 = 0.

Set x = y - 3/2, substitute and expand,

y4 + (-37/2) y2 + 32 y + (-231/16) = 0,
e = -37/2,   f = 32,   g = -231/16,
h6 + (-37) h4 + 400 h2 - 1024 = 0.

Solving this cubic in h2, we find

h2 = 16,   h2 = (21 + sqrt[185])/2,   h2 = (21 - sqrt[185])/2.

We only need one of these, so we pick h2 = 16, so

h = 4,
j = (e + h2 - f/h)/2,
j = -21/4,

and one factorization is

(y2 + 4 y - 21/4) (y2 - 4 y + 11/4) = 0,

or

(x2 + 7 x + 3) (x2 - x - 1) = 0.

From here the rest is easy, and

x = (-7 +- sqrt[37])/2,   x = (1 +- sqrt[5])/2,

are the four roots of the original equation.

Example 2: Find the roots of x4 + 6 x3 + 7 x2 - 7 x - 12 = 0.

Set x = y - 3/2, substitute and expand.

y4 + (-13/2) y2 + (-1) y + (-15/16) = 0,
e = -13/2,   f = -1,   g = -15/16,
z3 - (13/4) z2 + (23/8) z - 1/64 = 0.

Solving this cubic in z, we find the roots are

z = (26-cbrt[124 (31-3 sqrt[93])]+cbrt[124 (31+3 sqrt[93])])/24 = 0.005468531191,
z = 1.622657344 + 0.4748800537 i,
z = 1.622657344 - 0.4748800537 i,

approximately. Since the algebraic expressions for the roots z are rather complicated, we use numerical approximations from here on. Taking the square roots of the last two quantities, we find

p = 1.2869747589 + 0.1844947037 i,
q = 1.2869747589 - 0.1844947037 i,
r = 0.07394951785,

approximately. Then the four roots are

x = p + q + r - a/4,
x = p - q - r - a/4,
x = -p + q - r - a/4, and
x = -p - q + r - a/4.

From here the rest is easy,

x = 1.1478990357,   x = -1.5739495179 +/- 0.3689894075 i,   and   x = -4.0000000000,

are the four approximate roots of the original equation. It is easy to check that x = -4 is an exact root, and x + 4 divides the original polynomial exactly.

Incidentally, the exact expression for the irrational real root is

x = [-4+cbrt(4 [47-3 sqrt(93)])+cbrt(4 [47+3 sqrt(93)])]/6,

and there are analogous expressions for the complex conjugate roots which involve w = (-1+sqrt[-3])/2 and w2 = (-1-sqrt[-3])/2, the complex cube roots of 1.

Thanks to Daniel R. Collins for pointing out the special cases and their usefulness.

For some historical background, see Quadratic, cubic and quartic equations from the MacTutor Math History archives.

For derivations and examples, see The Cubic Formula and The Quartic Formula from the S.O.S. Mathematics site.

For an explanation of Cardan's geometric solution method for cubic equations, see R. W. D. Nickalls' article in PDF format from The Mathematical Gazette Vol. 77 (November, 1993): "A new approach to solving the cubic."

In the Dr. Math archives, see: