info prev up next book cdrom email home

Cubic Equation

A cubic equation is a Polynomial equation of degree three. Given a general cubic equation

\begin{displaymath}
z^3+a_2z^2+a_1z+a_0 = 0
\end{displaymath} (1)

(the Coefficient $a_3$ of $z^3$ may be taken as 1 without loss of generality by dividing the entire equation through by $a_3$), first attempt to eliminate the $a_2$ term by making a substitution of the form
\begin{displaymath}
z\equiv x-\lambda.
\end{displaymath} (2)

Then

$(x-\lambda)^3+a_2(x-\lambda)^2+a_1(x-\lambda)+a_0=0$ (3)
$(x^3-3\lambda x^2+3\lambda^2 x-\lambda^3)+a_2(x^2-2\lambda x+\lambda^2)+a_1(x-\lambda)+a_0=0$ (4)
$x^3+x^2(a_2-3\lambda)+x(a_1-2a_2\lambda+3\lambda^2)+(a_0-a_1\lambda+a_2\lambda^2-\lambda^3)=0.$ (5)
The $x^2$ is eliminated by letting $\lambda=a_2/3$, so

\begin{displaymath}
z\equiv x-{\textstyle{1\over 3}}a_2.
\end{displaymath} (6)

Then
$\displaystyle z^3$ $\textstyle =$ $\displaystyle (x-{\textstyle{1\over 3}}a_2)^3 = x^3-a_2x^2+{\textstyle{1\over 3}}{a_2}^2x-{\textstyle{1\over 27}}{a_2}^3$ (7)
$\displaystyle a_2z^2$ $\textstyle =$ $\displaystyle a_2(x-{\textstyle{1\over 3}}a_2)^2 = a_2x^2-{\textstyle{2\over 3}}{a_2}^2x+{\textstyle{1\over 9}}{a_2}^3$ (8)
$\displaystyle a_1z$ $\textstyle =$ $\displaystyle a_1(x-{\textstyle{1\over 3}}a_2) = a_1x-{\textstyle{1\over 3}}a_1a_2,$ (9)

so equation (1) becomes


\begin{displaymath}
x^3+(-a_2+a_2)x^2+({\textstyle{1\over 3}}{a_2}^2-{\textstyle...
...extstyle{1\over 9}}{a_2}^3+{\textstyle{1\over 3}}a_1a_2-a_0)=0
\end{displaymath} (10)


\begin{displaymath}
x^3+(a_1-{\textstyle{1\over 3}}{a_2}^2) x-({\textstyle{1\over 3}}a_1a_2-{\textstyle{2\over 27}}{a_2}^3-a_0)=0
\end{displaymath} (11)


\begin{displaymath}
x^3+3\cdot {3a_1-{a_2}^2\over 9}x-2\cdot{9a_1a_2-27a_0-2{a_2}^3\over 54} = 0.
\end{displaymath} (12)

Defining
$\displaystyle p$ $\textstyle \equiv$ $\displaystyle {3a_1-{a_2}^2\over 3}$ (13)
$\displaystyle q$ $\textstyle \equiv$ $\displaystyle {9a_1a_2-27a_0-2{a_2}^3\over 27}$ (14)

then allows (12) to be written in the standard form
\begin{displaymath}
x^3+px=q.
\end{displaymath} (15)

The simplest way to proceed is to make Vieta's Substitution
\begin{displaymath}
x=w-{p\over 3w},
\end{displaymath} (16)

which reduces the cubic to the equation
\begin{displaymath}
w^3-{p^3\over 27w^3}-q=0,
\end{displaymath} (17)

which is easily turned into a Quadratic Equation in $w^3$ by multiplying through by $w^3$ to obtain
\begin{displaymath}
(w^3)^2-q(w^3)-{\textstyle{1\over 27}}p^3=0
\end{displaymath} (18)

(Birkhoff and Mac Lane 1965, p. 106). The result from the Quadratic Equation is
$\displaystyle w^3$ $\textstyle =$ $\displaystyle {\textstyle{1\over 2}}\left({q\pm\sqrt{q^2+{\textstyle{4\over 27}...
...style{1\over 2}}q\pm\sqrt{{\textstyle{1\over 4}}q^2+{\textstyle{1\over 27}}p^3}$  
  $\textstyle =$ $\displaystyle R\pm\sqrt{R^2+Q^3}\,,$ (19)

where $Q$ and $R$ are sometimes more useful to deal with than are $p$ and $q$. There are therefore six solutions for $w$ (two corresponding to each sign for each Root of $w^3$). Plugging $w$ back in to (17) gives three pairs of solutions, but each pair is equal, so there are three solutions to the cubic equation.


Equation (12) may also be explicitly factored by attempting to pull out a term of the form $(x-B)$ from the cubic equation, leaving behind a quadratic equation which can then be factored using the Quadratic Formula. This process is equivalent to making Vieta's substitution, but does a slightly better job of motivating Vieta's ``magic'' substitution, and also at producing the explicit formulas for the solutions. First, define the intermediate variables

$\displaystyle Q$ $\textstyle \equiv$ $\displaystyle {3a_1-{a_2}^2\over 9}$ (20)
$\displaystyle R$ $\textstyle \equiv$ $\displaystyle {9a_2a_1-27a_0-2{a_2}^3\over 54}$ (21)

(which are identical to $p$ and $q$ up to a constant factor). The general cubic equation (12) then becomes
\begin{displaymath}
x^3+3Qx-2R=0.
\end{displaymath} (22)

Let $B$ and $C$ be, for the moment, arbitrary constants. An identity satisfied by Perfect Cubic equations is that
\begin{displaymath}
x^3-B^3=(x-B)(x^2+Bx+B^2).
\end{displaymath} (23)

The general cubic would therefore be directly factorable if it did not have an $x$ term (i.e., if $Q=0$). However, since in general $Q\not=0$, add a multiple of $(x-B)$--say $C(x-B)$--to both sides of (23) to give the slightly messy identity
\begin{displaymath}
(x^3-B^3)+C(x-B)=(x-B)(x^2+Bx+B^2+C)=0,
\end{displaymath} (24)

which, after regrouping terms, is
\begin{displaymath}
x^3+Cx-(B^3+BC)=(x-B)[x^2+Bx+(B^2+C)]=0.
\end{displaymath} (25)

We would now like to match the Coefficients $C$ and $-(B^3+BC)$ with those of equation (22), so we must have
\begin{displaymath}
C=3Q
\end{displaymath} (26)


\begin{displaymath}
B^3+BC=2R.
\end{displaymath} (27)

Plugging the former into the latter then gives
\begin{displaymath}
B^3+3QB=2R.
\end{displaymath} (28)

Therefore, if we can find a value of $B$ satisfying the above identity, we have factored a linear term from the cubic, thus reducing it to a Quadratic Equation. The trial solution accomplishing this miracle turns out to be the symmetrical expression
\begin{displaymath}
B=[R+\sqrt{Q^3+R^2}\,]^{1/3}+[R-\sqrt{Q^3+R^2}\,]^{1/3}.
\end{displaymath} (29)

Taking the second and third Powers of $B$ gives
$\displaystyle B^2$ $\textstyle =$ $\displaystyle [R+\sqrt{Q^3+R^2}]^{2/3}+2[R^2-(Q^3+R^2)]^{1/3}+[R-\sqrt{Q^3+R^2}]^{2/3}$  
  $\textstyle =$ $\displaystyle [R+\sqrt{Q^3+R^2}]^{2/3}+[R-\sqrt{Q^3+R^2}]^{2/3}-2Q$ (30)
$\displaystyle B^3$ $\textstyle =$ $\displaystyle -2QB+\left\{{[R+\sqrt{Q^3+R^2}]^{1/3}+[R-\sqrt{Q^3+R^2}]^{1/3}}\right\}$  
  $\textstyle \phantom{=}$ $\displaystyle \times \left\{{[R+\sqrt{Q^3+R^2}]^{2/3}+[R-\sqrt{Q^3+R^2}]^{2/3}}\right\}$  
  $\textstyle =$ $\displaystyle [R+\sqrt{Q^3+R^2}]+[R-\sqrt{Q^3+R^2}]$  
  $\textstyle \phantom{=}$ $\displaystyle + [R-\sqrt{Q^3+R^2}]^{1/3}[R-\sqrt{Q^3+R^2}]^{2/3}$  
  $\textstyle \phantom{=}$ $\displaystyle + [R-\sqrt{Q^3+R^2}]^{2/3}[R-\sqrt{Q^3+R^2}]^{1/3}-2QB$  
  $\textstyle =$ $\displaystyle -2QB+2R+[R^2-(Q^3+R^2)]^{1/3}$  
  $\textstyle \phantom{=}$ $\displaystyle \times\left[{\left({R+\sqrt{Q^3+R^2}}\right)^{1/3}+\left({R-\sqrt{Q^3-R^2}}\right)^{1/3}}\right]$  
  $\textstyle =$ $\displaystyle -2QB+2R-QB = -3QB+2R.$ (31)

Plugging $B^3$ and $B$ into the left side of (28) gives
\begin{displaymath}
(-3QB+2R)+3QB=2R,
\end{displaymath} (32)

so we have indeed found the factor $(x-B)$ of (22), and we need now only factor the quadratic part. Plugging $C=3Q$ into the quadratic part of (25) and solving the resulting
\begin{displaymath}
x^2+Bx+(B^2+3Q)=0
\end{displaymath} (33)

then gives the solutions
$\displaystyle x$ $\textstyle =$ $\displaystyle {\textstyle{1\over 2}}[-B\pm\sqrt{B^2-4(B^2+3Q)}\,]$  
  $\textstyle =$ $\displaystyle -{\textstyle{1\over 2}}B\pm{\textstyle{1\over 2}}\sqrt{-3B^2-12Q}$  
  $\textstyle =$ $\displaystyle -{\textstyle{1\over 2}}B\pm {\textstyle{1\over 2}}\sqrt{3}\,i \sqrt{B^2+4Q}\,.$ (34)

These can be simplified by defining


$\displaystyle A$ $\textstyle \equiv$ $\displaystyle [R+\sqrt{Q^3+R^2}\,]^{1/3}-[R-\sqrt{Q^3+R^2}\,]^{1/3}$ (35)
$\displaystyle A^2$ $\textstyle =$ $\displaystyle [R+\sqrt{Q^3+R^2}\,]^{2/3}-2[R^2-(Q^3+R^2)]^{1/3}+[R-\sqrt{Q^3+R^2}\,]^{2/3}$  
  $\textstyle =$ $\displaystyle [R+\sqrt{Q^3+R^2}\,]^{2/3}+[R-\sqrt{Q^3+R^2}\,]^{2/3}+2Q$  
  $\textstyle =$ $\displaystyle B^2+4Q,$ (36)

so that the solutions to the quadratic part can be written
\begin{displaymath}
x=-{\textstyle{1\over 2}}B\pm{\textstyle{1\over 2}}\sqrt{3}\,i A.
\end{displaymath} (37)

Defining
$\displaystyle D$ $\textstyle \equiv$ $\displaystyle Q^3+R^2$ (38)
$\displaystyle S$ $\textstyle \equiv$ $\displaystyle {\root 3 \of {R+\sqrt{D}}}$ (39)
$\displaystyle T$ $\textstyle \equiv$ $\displaystyle {\root 3 \of {R-\sqrt{D}}},$ (40)

where $D$ is the Discriminant (which is defined slightly differently, including the opposite Sign, by Birkhoff and Mac Lane 1965) then gives very simple expressions for $A$ and $B$, namely
$\displaystyle B$ $\textstyle =$ $\displaystyle S+T$ (41)
$\displaystyle A$ $\textstyle =$ $\displaystyle S-T.$ (42)

Therefore, at last, the Roots of the original equation in $z$ are then given by
$\displaystyle z_1$ $\textstyle =$ $\displaystyle -{\textstyle{1\over 3}} a_2+(S+T)$ (43)
$\displaystyle z_2$ $\textstyle =$ $\displaystyle - {\textstyle{1\over 3}} a_2 -{\textstyle{1\over 2}}(S+T) + {\textstyle{1\over 2}}i\sqrt{3}\,(S-T)$ (44)
$\displaystyle z_3$ $\textstyle =$ $\displaystyle - {\textstyle{1\over 3}} a_2 -{\textstyle{1\over 2}}(S+T) - {\textstyle{1\over 2}}i\sqrt{3}\,(S-T),$ (45)

with $a_2$ the Coefficient of $z^2$ in the original equation, and $S$ and $T$ as defined above. These three equations giving the three Roots of the cubic equation are sometimes known as Cardano's Formula. Note that if the equation is in the standard form of Vieta
\begin{displaymath}
x^3+px=q,
\end{displaymath} (46)

in the variable $x$, then $a_2=0$, $a_1=p$, and $a_0=-q$, and the intermediate variables have the simple form (c.f. Beyer 1987)
$\displaystyle Q$ $\textstyle =$ $\displaystyle {\textstyle{1\over 3}}p$ (47)
$\displaystyle R$ $\textstyle =$ $\displaystyle {\textstyle{1\over 2}}q$ (48)
$\displaystyle D$ $\textstyle \equiv$ $\displaystyle Q^3+R^2=\left({p\over 3}\right)^3+\left({q\over 2}\right)^2.$ (49)


The equation for $z_1$ in Cardano's Formula does not have an $i$ appearing in it explicitly while $z_2$ and $z_3$ do, but this does not say anything about the number of Real and Complex Roots (since $S$ and $T$ are themselves, in general, Complex). However, determining which Roots are Real and which are Complex can be accomplished by noting that if the Discriminant $D > 0$, one Root is Real and two are Complex Conjugates; if $D = 0$, all Roots are Real and at least two are equal; and if $D < 0$, all Roots are Real and unequal. If $D < 0$, define

\begin{displaymath}
\theta \equiv \cos^{-1}\left({R\over\sqrt{-Q^3}}\right).
\end{displaymath} (50)

Then the Real solutions are of the form
$\displaystyle z_1$ $\textstyle =$ $\displaystyle 2\sqrt{-Q} \cos\left({\theta\over 3}\right)-{\textstyle{1\over 3}}a_2$ (51)
$\displaystyle z_2$ $\textstyle =$ $\displaystyle 2\sqrt{-Q} \cos\left({\theta+2\pi\over 3}\right)-{\textstyle{1\over 3}}a_2$ (52)
$\displaystyle z_3$ $\textstyle =$ $\displaystyle 2\sqrt{-Q} \cos\left({\theta +4\pi\over 3}\right)-{\textstyle{1\over 3}}a_2.$ (53)

This procedure can be generalized to find the Real Roots for any equation in the standard form (46) by using the identity
\begin{displaymath}
\sin^3\theta-{\textstyle{3\over 4}}\sin\theta+{\textstyle{1\over 4}}\sin(3\theta)=0
\end{displaymath} (54)

(Dickson 1914) and setting
\begin{displaymath}
x\equiv \sqrt{4\vert p\vert\over 3}\,y
\end{displaymath} (55)

(Birkhoff and Mac Lane 1965, pp. 90-91), then
\begin{displaymath}
\left({4\vert p\vert\over 3}\right)^{3/2}y^3+p\sqrt{4\vert p\vert\over 3}\,y=q
\end{displaymath} (56)


\begin{displaymath}
y^3+{\textstyle{3\over 4}}{p\over\vert p\vert}y=\left({3\over 4\vert p\vert}\right)^{3/2}q
\end{displaymath} (57)


\begin{displaymath}
4y^3+3\mathop{\rm sgn}\nolimits (p)y={\textstyle{1\over 2}}q\left({3\over\vert p\vert}\right)^{3/2}\equiv C.
\end{displaymath} (58)

If $p>0$, then use
\begin{displaymath}
\sinh(3\theta)=4\sinh^3\theta+3\sinh\theta
\end{displaymath} (59)

to obtain
\begin{displaymath}
y=\sinh({\textstyle{1\over 3}}\sinh^{-1} C).
\end{displaymath} (60)

If $p<0$ and $\vert C\vert\geq 1$, use
\begin{displaymath}
\cosh(3\theta)=4\cosh^3\theta-3\cosh\theta,
\end{displaymath} (61)

and if $p<0$ and $\vert C\vert\leq 1$, use
\begin{displaymath}
\cos(3\theta)=4\cos^3\theta-3\cos\theta,
\end{displaymath} (62)

to obtain
\begin{displaymath}
y=\cases{
\cosh({\textstyle{1\over 3}}\cosh^{-1} C) & for $...
...{-1} C) \hbox{\ [three solutions]} & for
$\vert C\vert<1$.\cr}
\end{displaymath} (63)

The solutions to the original equation are then
\begin{displaymath}
x_i=2\sqrt{\vert p\vert\over 3}\,y_i-{\textstyle{1\over 3}} a_2.
\end{displaymath} (64)


An alternate approach to solving the cubic equation is to use Lagrange Resolvents. Let $\omega\equiv e^{2\pi i/3}$, define

$\displaystyle (1,x_1)$ $\textstyle =$ $\displaystyle x_1+x_2+x_3$ (65)
$\displaystyle (\omega,x_1)$ $\textstyle =$ $\displaystyle x_1+\omega x_2+\omega^2 x_3$ (66)
$\displaystyle (\omega^2, x_1)$ $\textstyle =$ $\displaystyle x_1+\omega^2 x_2+\omega x_3,$ (67)

where $x_i$ are the Roots of
\begin{displaymath}
x^3+px+q=0,
\end{displaymath} (68)

and consider the equation
\begin{displaymath}[x-(u_1+u_2)][x-(\omega u_1+\omega^2u_2)][x-(\omega^2u_1+\omega u_2)]=0,
\end{displaymath} (69)

where $u_1$ and $u_2$ are Complex Numbers. The Roots are then
\begin{displaymath}
x_j=\omega^ju_1+\omega^{2j}u_2
\end{displaymath} (70)

for $j=0$, 1, 2. Multiplying through gives
\begin{displaymath}
x^3-3u_1u_2x-({u_1}^3+{u_2}^3)=0,
\end{displaymath} (71)

or
\begin{displaymath}
x^3+px+q=0,
\end{displaymath} (72)

where
$\displaystyle {u_1}^3+{u_2}^3$ $\textstyle =$ $\displaystyle -q$ (73)
$\displaystyle {u_1}^3{u_2}^3$ $\textstyle =$ $\displaystyle -\left({1\over 3}\right)^3.$ (74)


The solutions satisfy Newton's Identities

$\displaystyle z_1+z_2+z_3$ $\textstyle =$ $\displaystyle -a_2$ (75)
$\displaystyle z_1z_2+z_2z_3+z_1z_3$ $\textstyle =$ $\displaystyle a_1$ (76)
$\displaystyle z_1z_2z_3$ $\textstyle =$ $\displaystyle -a_0.$ (77)

In standard form, $a_2=0$, $a_1=p$, and $a_0=-q$, so we have the identities
$\displaystyle p$ $\textstyle =$ $\displaystyle z_1z_2-{z_3}^2$ (78)
$\displaystyle (z_1-z_2)^2$ $\textstyle =$ $\displaystyle -(4p-3{z_3}^2)$ (79)
$\displaystyle {z_1}^2+{z_2}^2+{z_3}^2$ $\textstyle =$ $\displaystyle -2p.$ (80)

Some curious identities involving the roots of a cubic equation due to Ramanujan are given by Berndt (1994).

See also Quadratic Equation, Quartic Equation, Quintic Equation, Sextic Equation


References

Abramowitz, M. and Stegun, C. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, p. 17, 1972.

Berger, M. §16.4.1-16.4.11.1 in Geometry I. New York: Springer-Verlag, 1994.

Berndt, B. C. Ramanujan's Notebooks, Part IV. New York: Springer-Verlag, pp. 22-23, 1994.

Beyer, W. H. CRC Standard Mathematical Tables, 28th ed. Boca Raton, FL: CRC Press, pp. 9-11, 1987.

Birkhoff, G. and Mac Lane, S. A Survey of Modern Algebra, 3rd ed. New York: Macmillan, pp. 90-91, 106-107, and 414-417, 1965.

Dickson, L. E. ``A New Solution of the Cubic Equation.'' Amer. Math. Monthly 5, 38-39, 1898.

Dickson, L. E. Elementary Theory of Equations. New York: Wiley, pp. 36-37, 1914.

Dunham, W. ``Cardano and the Solution of the Cubic.'' Ch. 6 in Journey Through Genius: The Great Theorems of Mathematics. New York: Wiley, pp. 133-154, 1990.

Ehrlich, G. §4.16 in Fundamental Concepts of Abstract Algebra. Boston, MA: PWS-Kent, 1991.

Jones, J. ``Omar Khayyám and a Geometric Solution of the Cubic.'' http://jwilson.coe.uga.edu/emt669/Student.Folders/Jones.June/omar/omarpaper.html.

Kennedy, E. C. ``A Note on the Roots of a Cubic.'' Amer. Math. Monthly 40, 411-412, 1933.

King, R. B. Beyond the Quartic Equation. Boston, MA: Birkhäuser, 1996.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. ``Quadratic and Cubic Equations.'' §5.6 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 178-180, 1992.

Spanier, J. and Oldham, K. B. ``The Cubic Function $x^3+ax^2+bx+c$ and Higher Polynomials.'' Ch. 17 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 131-147, 1987.

van der Waerden, B. L. §64 in Algebra. New York: Frederick Ungar, 1970.



info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-25