% ----------------------------------------------------------------------

\chapter{Cubics and quartics}
\label{cubic}
\index{root}
\index{cubic expression}
\index{quartic expression}
\index{algebra!higher-order}
\index{higher-order algebra}

Under the heat of noonday, between the hard work of the morning and the
heavy lifting of the afternoon, one likes to lay down one's burden and
rest a spell in the shade.  Chapters~\ref{alggeo} through~\ref{inttx}
have established the applied mathematical foundations upon which coming
chapters will build; and
chapter~\ref{matrix},
hefting the weighty topic of the matrix, will indeed begin to build on
those foundations.  But in this short chapter which rests between, we
shall refresh ourselves with an interesting but lighter mathematical
topic: the topic of cubics and quartics.

\index{linear expression}
\index{quadratic expression}
\index{Newton-Raphson iteration}
\index{antiquity}
The expression
\[
  z + a_0
\]
is a \emph{linear} polynomial, the lone root $z = -a_0$ of which is
plain to see.  The \emph{quadratic} polynomial
\[
  z^2 + a_1z + a_0
\]
has of course two roots, which though not plain to see the quadratic
formula~(\ref{alggeo:240}) extracts with little effort.  So much algebra
has been known since antiquity.  The roots of higher-order polynomials,
the Newton-Raphson iteration~(\ref{drvtv:NR}) locates swiftly, but that
is an approximate iteration rather than an exact formula
like~(\ref{alggeo:240}), and as we have seen in \S~\ref{drvtv:270} it
can occasionally fail to converge.  One would prefer an actual formula
to extract the roots.

\index{Cardan, Girolamo
  (also known as Cardano or Cardanus, 1501--1576)}
\index{Tartaglia, Niccol\`o Fontana (1499--1557)}
\index{Ferrari, Lodovico (1522--1565)}
\index{Vieta, Franciscus (Fran\c cois Vi\`ete, 1540--1603)}
\index{$n$th-order expression}
\index{16th century}
No general formula to extract the roots of the $n$th-order
polynomial seems to be known.%
\footnote{
  Refer to chapter~\ref{noth}'s footnote~\ref{noth:320:fn20}.
}
However, to extract the roots of the \emph{cubic} and \emph{quartic}
polynomials
\bqb
  z^3 + a_2z^2 + a_1z + a_0, && \\
  z^4 + a_3z^3 + a_2z^2 + a_1z + a_0, &&
\eqb
though the ancients never discovered how, formulas do exist.
The 16th-century algebraists Ferrari, Vieta, Tartaglia and Cardan
have given us the clever technique.  This chapter explains.%
\footnote{%
  \cite[``Cubic equation'']{EWW}%
  \cite[``Quartic equation'']{EWW}%
  \cite[``Quartic equation,'' 00:26, 9~Nov.\ 2006]{wikip}%
  \cite[``Fran\c cois Vi\`ete,'' 05:17, 1~Nov.\ 2006]{wikip}%
  \cite[``Gerolamo Cardano,'' 22:35, 31~Oct.\ 2006]{wikip}%
  \cite[\S~1.5]{SRW}
}

% There is a controversy regarding Cardan, as to whether he plagiarized
% his most celebrated results.  The author does not know the facts of it
% but feels some unaccountable suspicion regarding the accusation.  Why
% we should believe the accuser and not the accused in this case
% remains unclear to the author, whose intuition warns him to suspect
% magnification of the controversy by someone who likes to magnify.  (If
% Tartaglia really did tell Cardan his secrets and then swear Cardan
% to secrecy, we have only Tartaglia's putative word for it as far as
% the author knows.  Besides, swearing someone to secrecy?  What is
% Tartaglia supposed to have been, a would-be member of the ancient
% Pythagorean cult?  If so, that's a bit weird.  Why didn't Tartaglia
% just publish his formula, if he was so worried about losing credit for
% it, eh?  Well, the author wonders if Tartaglia and Cardan weren't
% both pretty normal, in fact, and if the story of their conflict hasn't
% received some---shall we say---dramatic embellishment.)  The author
% does not wish to be unnecessarily credulous, nor is he really
% interested in researching the matter; so, in this book, Cardan is
% treated as innocent until proven guilty.  Tartaglia, too.
%
% (Some time after the writer wrote the last paragraph, he encountered
% Charles C. Pinter's sensational tale of Cardan and Tartaglia.  Pinter
% explains that scholarship in Cardan's day was not as scholarship
% today, and that Cardan had competed against at least one other
% algebraist for a prize or wager, using secret techniques.  Pinter's
% story is new to the writer, who has no particular reason to doubt it.
% If the story is accurate, it does make Cardan-conspiracy theories seem
% at least a little more probable.)
%
% Well, enough of that.  Back to the book.

% ----------------------------------------------------------------------

\section{Vieta's transform}
\label{cubic:200}
\index{Vieta's transform}
\index{Vieta, Franciscus (Fran\c cois Vi\`ete, 1540--1603)}

\index{Vieta's substitution}
There is a sense to numbers by which~$1/2$ resembles~$2$, $1/3$
resembles~$3$, $1/4$ resembles~$4$, and so forth.  To capture this
sense, one can transform a function $f(z)$ into a function $f(w)$ by the
change of variable%
\footnote{
  This change of variable broadly recalls the sum-of-exponentials
  form~(\ref{cexp:250:cosh}) of the $\cosh(\cdot)$ function,
  inasmuch as $\exp[-\phi] = 1/\exp\phi$.
}
\[
  w + \frac{1}{w} \la z,
\]
or, more generally,
\bq{cubic:200:10}
  w + \frac{w_o^2}{w} \la z.
\eq
Equation~(\ref{cubic:200:10}) is \emph{Vieta's transform.}%
\footnote{
  Also called ``Vieta's substitution.''\ %
  \cite[``Vieta's substitution'']{EWW}
}

\index{corner value}
For $\left|w\right| \gg \left|w_o\right|$, we have that $z \approx w$;
but as~$\left|w\right|$ approaches~$\left|w_o\right|$ this ceases to be
true.  For $\left|w\right| \ll \left|w_o\right|$, $z \approx w_o^2/w$.
The constant~$w_o$ is the \emph{corner value,} in the neighborhood of
which~$w$ transitions from the one domain to the other.
Figure~\ref{cubic:200:Vieta-fig} plots Vieta's transform for real~$w$ in
the case that $w_o=1$.
\begin{figure}
  \caption[Vieta's transform, plotted logarithmically.]
    {Vieta's transform~(\ref{cubic:200:10}) for $w_o=1$, plotted
    logarithmically.}
  \label{cubic:200:Vieta-fig}
  \bc
    \nc\fxa{-5.0} \nc\fxb{5.0}
    \nc\fya{-1.0} \nc\fyb{3.7}
    \nc\xxa{3.0}
    \nc\xxb{0.6}
    \nc\xxc{2.3}
    \nc\xxd{2.4}
    \nc\xxm{0.10}
    \nc\xxn{0.90}
    \begin{pspicture}(\fxa,\fya)(\fxb,\fyb)
      %\psframe[linewidth=0.5pt,dimen=outer](\fxa,\fya)(\fxb,\fyb)
      {
        \small
        \psset{dimen=middle}
        {
          \psset{linewidth=0.5pt}
          \psline(-\xxa,0)(\xxa,0)
          \psline(0,-\xxb)(0,\xxa)
          \uput[r](\xxa,0){$\ln w$}
          \uput[u](0,\xxa){$\ln z$}
          \psline[linestyle=dashed](0,0)( \xxc,\xxc)
          \psline[linestyle=dashed](0,0)(-\xxc,\xxc)
          \psline( \xxn,-\xxm)( \xxn,\xxm)
          \psline(-\xxn,-\xxm)(-\xxn,\xxm)
          \psline(-\xxm,\xxn)(\xxm,\xxn)
        }
        \psplot[linewidth=2.0pt,plotpoints=200]{-\xxd}{\xxd}{
          2.7183 x 0.9 div exp dup 1.0 exch div add ln 0.9 mul
        }
      }
    \end{pspicture}
  \ec
\end{figure}

\index{Vieta's parallel transform}
\index{parallel addition}
\index{addition!parallel}
An interesting alternative to Vieta's transform is
\bq{cubic:200:15}
  w \,\|\, \frac{w_o^2}{w} \la z,
\eq
which in light of \S~\ref{noth:420} might be named \emph{Vieta's
parallel transform.}

Section~\ref{cubic:220} shows how Vieta's transform can be used.

% ----------------------------------------------------------------------

\section{Cubics}
\label{cubic:220}
\index{cubic expression}

The general cubic polynomial is too hard to extract the roots of
directly, so one begins by changing the variable
\bq{cubic:220:10}
  x + h \la z
\eq
to obtain the polynomial
\[
  x^3 + (a_2+3h)x^2 + (a_1+2ha_2+3h^2)x + (a_0+ha_1+h^2a_2+h^3).
\]
The choice
\bq{cubic:220:15}
  h \equiv -\frac{a_2}{3}
\eq
casts the polynomial into the improved form
\[
  x^3 + \left[a_1-\frac{a_2^2}{3}\right]x +
  \left[a_0-\frac{a_1a_2}{3}+2\left(\frac{a_2}{3}\right)^3\right],
\]
or better yet
\[
  x^3 - px - q,
\]
where
\bq{cubic:220:20}
  \begin{split}
    p &\equiv -a_1+\frac{a_2^2}{3}, \\
    q &\equiv -a_0+\frac{a_1a_2}{3}-2\left(\frac{a_2}{3}\right)^3.
  \end{split}
\eq
The solutions to the equation
\bq{cubic:220:25}
  x^3 = px + q,
\eq
then, are the cubic polynomial's three roots.

\index{Vieta's transform}
So we have struck the~$a_2z^2$ term.  That was the easy part; what to
do next is not so obvious.  If one could strike the~$px$ term
as well, then the roots would follow immediately, but no very simple
substitution like~(\ref{cubic:220:10}) achieves this---or rather, such a
substitution does achieve it, but at the price of reintroducing an
unwanted~$x^2$ or~$z^2$ term.  That way is no good.  Lacking guidance,
one might try many, various substitutions, none of which seems to help
much; but after weeks or months of such frustration one might eventually
discover Vieta's transform~(\ref{cubic:200:10}), with the idea of
balancing the equation between offsetting~$w$ and~$1/w$ terms.  This
works.

Vieta-transforming~(\ref{cubic:220:25}) by the change of variable
\bq{cubic:200:28}
  w + \frac{w_o^2}{w} \la x
\eq
we get the new equation
\bq{cubic:220:35}
  w^3 + (3w_o^2-p)w + (3w_o^2-p)\frac{w_o^2}{w} + \frac{w_o^6}{w^3} = q,
\eq
which invites the choice
\bq{cubic:220:40}
  w_o^2 \equiv \frac{p}{3},
\eq
reducing~(\ref{cubic:220:35}) to read
\[
  w^3 + \frac{(p/3)^3}{w^3} = q.
\]
Multiplying by~$w^3$ and rearranging terms, we have the quadratic
equation
\bq{cubic:220:45}
  (w^3)^2 = 2\left(\frac{q}{2}\right)w^3 - \left(\frac{p}{3}\right)^3,
\eq
which by~(\ref{alggeo:240:quad}) we know how to solve.

\index{quadratic expression}
Vieta's transform has reduced the original cubic to a quadratic.

\index{coefficient!inscrutable}
The careful reader will observe that~(\ref{cubic:220:45}) seems to imply
six roots, double the three the fundamental theorem of algebra
(\S~\ref{noth:320.30}) allows a cubic polynomial to have.  We shall
return to this point in \S~\ref{cubic:235}.  For the moment, however, we
should like to improve the notation by defining%
\footnote{
  Why did we not define~$P$ and~$Q$ so to begin with?  Well, before
  unveiling~(\ref{cubic:220:45}), we lacked motivation to do so.  To
  define inscrutable coefficients unnecessarily before the need for them
  is apparent seems poor applied mathematical style.
}
\bq{cubic:220:50}
  \begin{split}
    P &\la -\frac{p}{3}, \\
    Q &\la +\frac{q}{2},
  \end{split}
\eq
with which~(\ref{cubic:220:25}) and~(\ref{cubic:220:45}) are written,
\bqa
  x^3 &=& 2Q - 3Px, \label{cubic:220:55} \\
  (w^3)^2 &=& 2Qw^3 + P^3. \label{cubic:220:58}
\eqa
Table~\ref{cubic:cubic-table} summarizes the complete cubic-polynomial
root-extraction meth\-od\footnote{\cite[eqn.~5.3]{Spiegel/Liu}}
in the revised notation---including a few fine
points regarding superfluous roots and edge cases, treated in
\S\S~\ref{cubic:235} and~\ref{cubic:240} below.
\begin{table}
  \caption[A method to extract the three roots of the general cubic.]
    {A method to extract the three roots of the general cubic polynomial.
      (In the definition of~$w^3$, one can choose either sign for
      the~$\pm$.)}
  \label{cubic:cubic-table}
  \index{cubic expression!roots of}
  \index{root extraction!from a cubic polynomial}
  \index{cubic formula}
  \settowidth\tla{$Q \pm \sqrt{ Q^2 + P^3 }$}
  \bqb
    0 &=& z^3 + a_2z^2 + a_1z + a_0 \\
    P &\equiv& \frac{a_1}{3}-\left(\frac{a_2}{3}\right)^2 \\
    Q &\equiv& \frac{1}{2}\left[-a_0+3\left(\frac{a_1}{3}\right)\left(\frac{a_2}{3}\right)-2\left(\frac{a_2}{3}\right)^3\right] \\
    w^3 &\equiv& \left\{
      \br{ll}
        2Q & \mbox{if $P=0$,} \\
        Q \pm \sqrt{ Q^2 + P^3 } & \mbox{otherwise.}
      \er
    \right. \\
    x &\equiv& \left\{
      \br{ll}
        \makebox[\tla][l]{$0$} & \mbox{if $P=0$ and $Q=0$}, \\
        w - P/w & \mbox{otherwise.}
      \er
    \right. \\
    z &=& x - \frac{a_2}{3}
  \eqb
\end{table}

% ----------------------------------------------------------------------

\section{Superfluous roots}
\label{cubic:235}
\index{superfluous root}
\index{root!superfluous}

As \S~\ref{cubic:220} has observed, the equations of
Table~\ref{cubic:cubic-table} seem to imply six roots, double the three
the fundamental theorem of algebra (\S~\ref{noth:320.30}) allows a cubic
polynomial to have.  However, what the equations really imply is not six
distinct roots but six distinct~$w$.  The definition $x \equiv w - P/w$
maps two~$w$ to any one~$x$, so in fact the equations imply only
three~$x$ and thus three roots~$z$.  The question then is: of the
six~$w$, which three do we really need and which three can we ignore as
superfluous?

The six~$w$ naturally come in two groups of three: one group of three
from the one~$w^3$ and a second from the other.  For this reason, we
will guess---and logically it is only a guess---that a single~$w^3$
generates three distinct~$x$ and thus (because~$z$ differs from~$x$ only by a
constant offset) all three roots~$z$.  If the guess is right,
then the second~$w^3$ cannot but yield the same three roots, which means
that the second~$w^3$ is superfluous and can safely be overlooked.  But
is the guess right?  Does a single~$w^3$ in fact generate three
distinct~$x$?

\index{squaring}
\index{cubing}
To prove that it does, let us suppose that it did not.  Let us suppose
that a single~$w^3$ did generate two~$w$ which led to the same~$x$.
Letting the symbol~$w_1$ represent the third~$w$, then (since all
three~$w$ come from the same~$w^3$) the two~$w$ are $w=e^{\pm
i2\pi/3}w_1$.  Because $x \equiv w - P/w$, by successive steps,
\bqb
  e^{+i2\pi/3}w_1 - \frac{P}{e^{+i2\pi/3}w_1} &=& e^{-i2\pi/3}w_1 - \frac{P}{e^{-i2\pi/3}w_1}, \\
  e^{+i2\pi/3}w_1 + \frac{P}{e^{-i2\pi/3}w_1} &=& e^{-i2\pi/3}w_1 + \frac{P}{e^{+i2\pi/3}w_1}, \\
  e^{+i2\pi/3}\left( w_1 + \frac{P}{w_1} \right) &=& e^{-i2\pi/3}\left( w_1 + \frac{P}{w_1} \right),
\eqb
which can only be true if
\[
  w_1^2 = -P.
\]
Cubing%
\footnote{
  The verb \emph{to cube} in this context means ``to raise to the third
  power,'' as to change~$y$ to~$y^3$, just as the verb \emph{to
  square} means ``to raise to the second power.''
}
the last equation,
\[
  w_1^6 = -P^3;
\]
but squaring the table's~$w^3$ definition for $w=w_1$,
\[
  w_1^6 = 2Q^2 + P^3 \pm 2Q\sqrt{ Q^2 + P^3 }.
\]
Combining the last two on~$w_1^6$,
\[
  -P^3 = 2Q^2 + P^3 \pm 2Q\sqrt{ Q^2 + P^3 },
\]
or, rearranging terms and halving,
\[
  Q^2 + P^3 = \mp Q\sqrt{ Q^2 + P^3 }.
\]
Squaring,
\[
  Q^4 + 2Q^2P^3 + P^6 = Q^4 + Q^2P^3,
\]
then canceling offsetting terms and factoring,
\[
  (P^3)(Q^2 + P^3) = 0.
\]
The last equation demands rigidly that either $P=0$ or $P^3=-Q^2$.  Some
cubic polynomials do meet the demand---\S~\ref{cubic:240} will treat
these and the reader is asked to set them aside for the moment---but
most cubic polynomials do not meet it.  For most cubic polynomials,
then, the contradiction proves false the assumption which gave rise to
it.  The assumption: that the three~$x$ descending from a single~$w^3$
were not distinct.  Therefore, provided that $P \neq 0$ and $P^3 \neq
-Q^2$, the three~$x$ descending from a single~$w^3$ are indeed distinct,
as was to be demonstrated.

The conclusion: \emph{either, not both, of the two signs in the table's
quadratic solution $w^3 \equiv Q \pm \sqrt{ Q^2 + P^3 }$ demands to be
considered.}  One can choose either sign; it matters not which.%
\footnote{
  Numerically, it can matter.  As a simple rule, because~$w$ appears in
  the denominator of $x$'s definition, when the two~$w^3$ differ in
  magnitude one might choose the larger.
}
The one sign alone yields all three roots of the general cubic
polynomial.

To calculate the three~$w$ from~$w^3$, one can apply the
Newton-Raphson iteration~(\ref{drvtv:270:35}), the Taylor series of
Table~\ref{taylor:315:tbl}, or any other convenient root-finding
technique to find a single root~$w_1$ such that $w_1^3 = w^3$.  The
other two roots then come easier.  They are $e^{\pm i2\pi/3}w_1$; but $e^{\pm
i2\pi/3} = (-1 \pm i\sqrt 3)/2$, so
\bq{cubic:235:60}
  w = w_1, \frac{-1 \pm i\sqrt 3}{2} w_1.
\eq

% This paragraph is probably unneeded.
%\index{double root}
%\index{root!double}
%We should observe, incidentally, that nothing prevents two actual roots
%of a cubic polynomial from having the same value.  This certainly is
%possible, and it does not mean that one of the two roots is superfluous
%or that the polynomial has fewer than three roots.  For example, the
%cubic polynomial $(z-1)(z-1)(z-2) = z^3 - 4z^2 + 5z - 2$ has roots
%at~$1$, $1$ and~$2$, with a single root at $z=2$ and a double
%root---that is, two roots---at $z=1$.  When this happens, the method of
%Table~\ref{cubic:cubic-table} properly yields the single root once and
%the double root twice, just as it ought to do.

% ----------------------------------------------------------------------

\section{Edge cases}
\label{cubic:240}
\index{edge case}

Section~\ref{cubic:235} excepts the edge cases $P=0$ and $P^3=-Q^2$\@.
Mostly the book does not worry much about edge cases, but the effects
of these cubic edge cases seem sufficiently nonobvious that the
book might include here a few words about them, if for no other
reason than to offer the reader a model of how to think about edge cases
on his own.  Table~\ref{cubic:cubic-table} gives the quadratic solution
\[
  w^3 \equiv Q \pm \sqrt{ Q^2 + P^3 },
\]
in which \S~\ref{cubic:235} generally finds it sufficient to consider
either of the two signs.  In the edge case $P=0$,
\[
  w^3 = 2Q \ \mbox{or}\ 0.
\]
In the edge case $P^3=-Q^2$,
\[
  w^3 = Q.
\]
Both edge cases are interesting.  In this section, we shall consider
first the edge cases themselves, then their effect on the proof of
\S~\ref{cubic:235}.

The edge case $P=0$, $Q\neq 0$, like the general non-edge case, gives
two distinct quadratic solutions~$w^3$.  One of the two however is
$w^3=Q-Q=0$, which is awkward in light of
Table~\ref{cubic:cubic-table}'s definition that $x \equiv w-P/w$.  For
this reason, in applying the table's method when $P=0$, one chooses the
other quadratic solution, $w^3 = Q + Q = 2Q$.
(A reader who wishes to take extra care of the logic might here ask how
one can be entirely sure that $w^3=0$ is not the~$w^3$ we want to use
despite that $x \equiv w-P/w$.  More than one answer to this concern
could be given.  One answer would be that the fundamental theorem of
algebra, \S~\ref{noth:320.30}, implies three finite roots; so,
since~$w^3=0$ can supply none of the three, it must be that $w^3=2Q$
supplies all of them.  A different answer is given later in the
section.)

The edge case $P^3=-Q^2\neq 0$ gives only the one quadratic solution
$w^3=Q$; or, more precisely, it gives two quadratic solutions which
happen to have the same value.  This is fine.  One merely accepts
that $w^3=Q$ and does not worry about choosing one~$w^3$ over the
other.

Neither edge case yields more than one, distinct, usable value
for~$w^3$, evidently.  It would seem that the two edge cases were not
troubled by the superfluous roots of \S~\ref{cubic:235}.

\index{triple root}
\index{root!triple}
\index{corner case}
The double edge case, or \emph{corner case,} arises where the two edges
meet---where $P=0$ and $P^3=-Q^2$, or equivalently where $P=0$ and
$Q=0$.  At the corner, the trouble is that $w^3 = 0$ and that no
alternate~$w^3$ is available.  However, according
to~(\ref{cubic:220:55}), $x^3 = 2Q - 3Px$, which in this case means that
$x^3 = 0$ and thus that $x = 0$ absolutely, no other~$x$ being possible.
This implies the triple root $z=-a_2/3$.

\index{double root}
\index{root!double}
And how about merely \emph{double} roots?  Section~\ref{cubic:235} has
already shown that double roots cannot arise in non-edge cases.  One
can conclude that all cases of double roots are edge cases.  (To
identify to which of the two edge cases a double root corresponds is
left as an exercise to the interested reader.\footnote{%
  The writer has not had cause to investigate the matter.%
})

Section~\ref{cubic:235} has excluded the edge cases from its proof of
the sufficiency of a single~$w^3$.  Let us now add the edge cases to the
proof.  In the edge case $P^3=-Q^2$, both~$w^3$ are the same, so the
one~$w^3$ suffices by default because the other~$w^3$ brings nothing
different.  The edge case $P=0$ however does give two distinct~$w^3$,
one of which is $w^3=0$, which puts an awkward $0/0$ in the table's
definition of~$x$.  We address this edge in the spirit of l'H\^opital's
rule, by sidestepping it, changing~$P$ infinitesimally from $P=0$ to
$P=\ep$.  Then, choosing the~$-$ sign in the definition
of~$w^3$,
\bqb
  w^3 &=& Q - \sqrt{Q^2+\ep^3}
    = Q - (Q)\left(1+\frac{\ep^3}{2Q^2}\right)
    = -\frac{\ep^3}{2Q}, \\
  w &=& -\frac{\ep}{(2Q)^{1/3}}, \\
  x &=& w - \frac{\ep}{w}
    = -\frac{\ep}{(2Q)^{1/3}} + (2Q)^{1/3}
    = (2Q)^{1/3}.
\eqb
But choosing the~$+$ sign,
\bqb
  w^3 &=& Q + \sqrt{Q^2+\ep^3} = 2Q, \\
  w &=& (2Q)^{1/3}, \\
  x &=& w - \frac{\ep}{w} = (2Q)^{1/3} - \frac{\ep}{(2Q)^{1/3}}
    = (2Q)^{1/3}.
\eqb
Evidently the roots come out the same, either way.  This completes the
proof.

% ----------------------------------------------------------------------

\section{Quartics}
\label{cubic:250}
\index{quartic expression}

\index{Ferrari, Lodovico (1522--1565)}
Having successfully extracted the roots of the general cubic polynomial,
we now turn our attention to the general quartic.  The kernel of the
cubic technique lay in reducing the cubic to a quadratic.  The kernel of
the quartic technique lies likewise in reducing the quartic to a cubic.
The details differ, though; and, strangely enough, in some ways the
quartic reduction is actually the simpler.%
\footnote{%
  \label{cubic:250:09}%
  Even stranger, historically Ferrari discovered it earlier
  \cite[``Quartic equation'']{EWW}\@.  Apparently Ferrari discovered the
  quartic's resolvent cubic~(\ref{cubic:250:30}), which he could not
  solve until Tartaglia applied Vieta's transform to it.  What motivated
  Ferrari to chase the quartic solution while the cubic solution
  remained still unknown, this writer does not know, but one supposes
  that it might make an interesting story.

  The reason the quartic is simpler to reduce is perhaps related to the
  fact that $(1)^{1/4} = \pm 1, \pm i$, whereas $(1)^{1/3} = 1, (-1 \pm
  i\sqrt 3)/2$.  The $(1)^{1/4}$ brings a much neater result, the roots
  lying nicely along the Argand axes.  This may also be why the quintic
  is intractable---but here we trespass the professional mathematician's
  territory and stray from the scope of this book.  See chapter~\ref{noth}'s
  footnote~\ref{noth:320:fn20}.
}

\index{cleverness}
As with the cubic, one begins solving the quartic by changing the
variable
\bq{cubic:250:10}
  x + h \la z
\eq
to obtain the equation
\bq{cubic:250:15}
  x^4 = sx^2 + px + q,
\eq
where
\bq{cubic:250:20}
  \nc\xh{\ensuremath{\frac{a_3}{4}}}
  \nc\yh{\ensuremath{\left(\xh\right)}}
  \begin{split}
    h &\equiv -\xh, \\
    %s &\equiv 6h^2 + 3h  a_3 +     a_2, \\
    %p &\equiv 4h^3 + 3h^2a_3 + 2h  a_2 +  a_1, \\
    %q &\equiv  h^4 +  h^3a_3 +  h^2a_2 + ha_1 + a_0.
    s &\equiv -a_2 + 6\yh^2, \\
    p &\equiv -a_1 + 2a_2\yh - 8\yh^3, \\
    q &\equiv -a_0 + a_1\yh - a_2\yh^2 + 3\yh^4.
  \end{split}
\eq
To reduce~(\ref{cubic:250:15}) further, one must be cleverer.
Ferrari%
\footnote{\cite[``Quartic equation'']{EWW}}
supplies the cleverness.  The clever idea is to transfer some but not
all of the~$sx^2$ term to the equation's left side by
\[
  x^4 + 2ux^2 = (2u+s)x^2 + px + q,
\]
where~$u$ remains to be chosen; then to complete the square on the
equation's left side as in \S~\ref{alggeo:240}, but with respect
to~$x^2$ rather than~$x$, as
\bq{cubic:250:24}
  \left( x^2 + u \right)^2 = k^2x^2 + px + j^2,
\eq
where
\bq{cubic:250:25}
  \begin{split}
    k^2 &\equiv 2u+s, \\
    j^2 &\equiv u^2+q.
  \end{split}
\eq
Now, one must regard~(\ref{cubic:250:24}) and~(\ref{cubic:250:25})
properly.  In these equations,~$s$, $p$ and~$q$ have definite values
fixed by~(\ref{cubic:250:20}), but not so~$u$, $j$ or~$k$.
The variable~$u$ is completely free; we have introduced it ourselves and
can assign it any value we like.  And though~$j^2$ and~$k^2$ depend
on~$u$, still, even after specifying~$u$ we remain free at least
to choose signs for~$j$ and~$k$.  As for~$u$, though no choice would
truly be wrong, one supposes that a wise choice might at least
render~(\ref{cubic:250:24}) easier to simplify.

\index{constraint}
So, what choice for~$u$ would be wise?  Well, look
at~(\ref{cubic:250:24}).  The left side of that equation is a perfect
square.  The right side would be, too, if it were that $p = \pm 2jk$;
so, arbitrarily choosing the~$+$ sign, we propose the constraint that
\bq{cubic:250:27}
  p = 2jk,
\eq
or, better expressed,
\bq{cubic:250:32}
  j = \frac{p}{2k}.
\eq
Squaring~(\ref{cubic:250:27}) and substituting for~$j^2$ and~$k^2$
from~(\ref{cubic:250:25}), we have that
\[
  p^2 = 4(2u+s)(u^2+q);
\]
or, after distributing factors, rearranging terms and scaling, that
\bq{cubic:250:30}
  \index{quartic expression!resolvent cubic of}
  \index{resolvent cubic}
  0 = u^3 + \frac{s}{2}u^2 + qu + \frac{4sq-p^2}{8}.
\eq
Equation~(\ref{cubic:250:30}) is the \emph{resolvent cubic,} which we
know by Table~\ref{cubic:cubic-table} how to solve for~$u$, and which we
now specify as a second constraint.  If the
constraints~(\ref{cubic:250:32}) and~(\ref{cubic:250:30}) are both
honored, then we can safely substitute~(\ref{cubic:250:27})
into~(\ref{cubic:250:24}) to reach the form
\[
  \left( x^2 + u \right)^2 = k^2x^2 + 2jkx + j^2,
\]
which is
\bq{cubic:250:35}
  \big( x^2 + u \big)^2 =
  \big( kx + j \big)^2.
\eq

The resolvent cubic~(\ref{cubic:250:30}) of course yields three~$u$ not
one, but the resolvent cubic is a voluntary constraint, so we can just
pick one~$u$ and ignore the other two.  Equation~(\ref{cubic:250:25})
then gives~$k$ (again, we can just pick one of the two signs),
and~(\ref{cubic:250:32}) then gives~$j$.  With~$u$, $j$ and~$k$
established,~(\ref{cubic:250:35}) implies the quadratic
\bq{cubic:250:40}
  x^2 = \pm ( kx + j ) - u,
\eq
which~(\ref{alggeo:240:quad}) solves as
\bq{cubic:250:50}
  x = \pm \frac{k}{2} \,\pm_o \sqrt{
    \left(\frac{k}{2}\right)^2 \pm j - u
  },
\eq
wherein the two~$\pm$ signs are tied together but the third,~$\pm_o$
sign is independent of the two.  Equation~(\ref{cubic:250:50}), with
the other equations and definitions of this section, reveals the four
roots of the general quartic polynomial.

In view of~(\ref{cubic:250:50}), the change of variables
\bq{cubic:250:60}
  \begin{split}
    K &\la \frac{k}{2}, \\
    J &\la j,
  \end{split}
\eq
improves the notation.  Using the improved notation,
Table~\ref{cubic:quartic-table} summarizes the complete
quartic-polynomial root-extraction method.
\begin{table}
  \caption[A method to extract the four roots of the general quartic.]
    {A method to extract the four roots of the general quartic
    polynomial.  (In the table, the resolvent cubic is solved for~$u$ by
    the method of Table~\ref{cubic:cubic-table}, where any one of the three
    resulting~$u$ serves.  Either of the two~$K$ similarly serves.  Of
    the three~$\pm$ signs in $x$'s definition, the~$\pm_o$ is
    independent but the other two are tied together, the four resulting
    combinations giving the four roots of the general quartic.)}
  \label{cubic:quartic-table}
  \index{quartic expression!roots of}
  \index{root extraction!from a quartic polynomial}
  \index{quartic formula}
  \nc\xh{\ensuremath{\frac{a_3}{4}}}
  \nc\yh{\ensuremath{\left(\xh\right)}}
  \bqb
    0 &=& z^4 + a_3z^3 + a_2z^2 + a_1z + a_0 \\
    s &\equiv& -a_2 + 6\yh^2 \\
    p &\equiv& -a_1 + 2a_2\yh - 8\yh^3 \\
    q &\equiv& -a_0 + a_1\yh - a_2\yh^2 + 3\yh^4 \\
    0 &=& u^3 + \frac{s}{2}u^2 + qu + \frac{4sq-p^2}{8} \\
    K &\equiv& \pm \frac{\sqrt{2u+s}}{2} \\
    J &\equiv& \begin{cases}
      \pm \sqrt{u^2+q} &\mbox{if $K=0$,} \\
      p/4K &\mbox{otherwise.}
    \end{cases} \\
    x &\equiv& \pm K \,\pm_o \sqrt{ K^2 \pm J - u } \\
    z &=& x - \xh
  \eqb
\end{table}

% ----------------------------------------------------------------------

\section{Guessing the roots}
\label{cubic:700}
\index{guessing roots}
\index{root!guessing of}

\index{baroquity}
It is entertaining to put pencil to paper and use
Table~\ref{cubic:cubic-table}'s method to extract the roots of the
cubic polynomial
\[
  0 = [z-1][z-i][z+i] = z^3 - z^2 + z - 1.
\]
One finds that
% P = 2/9, Q = 0xA/0x1B
\bqb
  z &=& w+\frac{1}{3}-\frac{2}{3^2w}, \\
  w^3 &\equiv& \frac{2 \left(5 + \sqrt{3^3}\right)}{3^3},
\eqb
which says indeed that $z=1,\pm i$, but just you try to simplify it!
A more baroque, more impenetrable way to write the number~$1$ is not easy
to conceive.  One has found the number~$1$ but cannot recognize it.
Figuring the square and cube roots in the expression numerically, the
root of the polynomial comes mysteriously to $1.0000$, but why?  The
root's symbolic form gives little clue.

\index{quintic expression}
In general no better way is known;%
\footnote{
  At least, no better way is known to this author.  If any reader can
  straightforwardly simplify the expression without solving a cubic
  polynomial of some kind, the author would like to hear of it.
}
we are stuck with the cubic baroquity.  However, to the extent to which a
cubic, a quartic, a quintic or any other polynomial has real, rational
roots, a trick is known to sidestep Tables~\ref{cubic:cubic-table}
and~\ref{cubic:quartic-table} and guess the roots directly.  Consider
for example the quintic polynomial
\[
  z^5 - \frac 7 2 z^4 + 4 z^3 + \frac 1 2 z^2 - 5 z + 3.
\]
Doubling to make the coefficients all integers produces the polynomial
\[
  2z^5 - 7z^4 + 8z^3 + 1z^2 - \mbox{0xA}z + 6,
\]
which naturally has the same roots.
If the roots are complex or irrational, they are hard to guess; but if any
of the roots happens to be real and rational, it must belong to the set
\[
  \left\{
    \pm 1, \pm 2, \pm 3, \pm 6,
    \pm \frac 1 2, \pm \frac 2 2,
    \pm \frac 3 2, \pm \frac 6 2
  \right\}.
\]
No other real, rational root is possible.  Trying the several
candidates on the polynomial, one finds that~$1$, $-1$ and~$3/2$ are
indeed roots.  Dividing these out leaves a quadratic which is easy to
solve for the remaining roots.

\index{relative primeness}
\index{prime number!relative}
\index{root!rational}
\index{rational root}
The real, rational candidates are the factors of the polynomial's
trailing coefficient (in the example,~$6$, whose factors are~$\pm 1$,
$\pm 2$, $\pm 3$ and~$\pm 6$) divided by the factors of the polynomial's
leading coefficient (in the example,~$2$, whose factors are~$\pm 1$
and~$\pm 2$).  The reason no other real, rational root is possible is
seen%
\footnote{
  The presentation here is quite informal.  We do not want to spend many
  pages on this.
}
by writing $z=p/q$---where~$p,q \in \mathbb Z$ are integers and the
fraction $p/q$ is fully reduced---and then multiplying the $n$th-order
polynomial by~$q^n$ to reach the form
\[
  a_np^n + a_{n-1}p^{n-1}q + \cdots + a_1pq^{n-1} + a_0q^n = 0,
\]
where all the coefficients~$a_k$ are integers.  Moving the~$q^n$ term to
the equation's right side, we have that
\[
  \left( a_np^{n-1} + a_{n-1}p^{n-2}q + \cdots + a_1q^{n-1} \right) p = -a_0q^n,
\]
which implies that~$a_0q^n$ is a multiple of~$p$.  But by demanding that
the fraction $p/q$ be fully reduced, we have defined~$p$ and~$q$
to be \emph{relatively prime} to one another---that is, we have defined
them to have no factors but~$\pm 1$ in common---so, not only~$a_0q^n$
but~$a_0$ itself is a multiple of~$p$.  By similar reasoning,~$a_n$ is a
multiple of~$q$.  But if~$a_0$ is a multiple of~$p$, and~$a_n$, a
multiple of~$q$, then~$p$ and~$q$ are factors of~$a_0$ and~$a_n$
respectively.  We conclude for this reason, as was to be demonstrated,
that no real, rational root is possible except a factor of~$a_0$ divided
by a factor of~$a_n$.%
\footnote{\cite[\S~3.2]{SRW}}

Such root-guessing is little more than an algebraic trick, of course,
but it can be a pretty useful trick if it saves us the embarrassment of
inadvertently expressing simple rational numbers in ridiculous ways.

One could write much more about higher-order algebra, but now that the
reader has tasted the topic he may feel inclined to agree that, though
the general methods this chapter has presented to solve cubics and
quartics are interesting, further effort were nevertheless probably
better spent elsewhere.  The next several chapters turn to the topic of
the matrix, harder but much more profitable, toward which we mean to put
substantial effort.

