\sectiontitle{Mathematical Formulae using Plain \TeX}
\label{pl-math}
\subsectiontitle{Mathematics Mode}
In order to obtain a mathematical formula using \TeX, one must
enter {\it mathematics mode} before the formula and leave it
afterwards. Mathematical formulae can occur either embedded in text
or else displayed on a separate line. When a formula occurs within
the text of a paragraph one should place a \verb?$? sign before and
after the formula, in order to enter and leave mathematics mode.
Thus to obtain a sentence like
\begin{quotation}
\small
Let $f$ be the function defined by $f(x) = 3x + 7$, and
let $a$ be a positive real number.
\end{quotation}
one should type
\begin{quote}
\begin{verbatim}
Let $f$ be the function defined by $f(x) = 3x + 7$, and
let $a$ be a positive real number.
\end{verbatim}
\end{quote}
In particular, note that even mathematical expressions consisting
of a single character, like $f$ and $a$ in the example above, are
placed within \verb?$? signs. This is to ensure that they are set
in italic type, as is customary in mathematical typesetting.
In order to obtain an mathematical formula or equation which
is displayed on a line by itself, one places \verb?$$? before and
after the formula. Thus to obtain
\begin{quotation}
\small
The product of two first degree polynomials is a quadratic
polynomial. For example, if $f(x) = 3x + 7$ and $g(x) = x + 4$
then
$$f(x)g(x) = 3x^2 + 19x +28.$$
The converse does not hold for polynomials over the field of
real numbers. However if we consider polynomials over the
complex field then every polynomial factorizes as a product
of first degree polynomials, by the Fundamental Theorem of Algebra.
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
The product of two first degree polynomials is a quadratic
polynomial. For example, if $f(x) = 3x + 7$ and $g(x) = x + 4$
then
$$f(x)g(x) = 3x^2 + 19x +28.$$
The converse does not hold for polynomials over the field of
real numbers. However if we consider polynomials over the
complex field then every polynomial factorizes as a product
of first degree polynomials, by the Fundamental Theorem of Algebra.
\end{verbatim}
\end{quote}
Numbered equations are produced using the control sequence
\verb?\eqno?. For example, if we type
\begin{quote}
\begin{verbatim}
$$f(x)g(x) = 3x^2 + 19x +28.\eqno(15)$$
\end{verbatim}
\end{quote}
we obtain
$$f(x)g(x) = 3x^2 + 19x +28.\eqno(15)$$
We obtain displayed equations with numbers on the left hand
side by using \verb?\leqno? in place of \verb?\eqno?. Thus
if we type
\begin{quote}
\begin{verbatim}
$$f(x)g(x) = 3x^2 + 19x +28.\leqno(15)$$
\end{verbatim}
\end{quote}
we obtain
$$f(x)g(x) = 3x^2 + 19x +28.\leqno(15)$$
\subsectiontitle{Characters in Mathematics Mode}
All the characters on the keyboard have their standard meaning
in mathematics mode, with the exception of the characters
\begin{verbatim}
# $ % & ~ _ ^ \ { } '
\end{verbatim}
Letters are set in italic type. In mathematics mode the character
\verb?'? has a special meaning: typing \verb?$f' + g''$?
produces $f' + g''$. When in mathematics mode the spaces you type
between letters and other symbols do not affect the spacing of
the final result, since \TeX\ determines the spacing of characters
in formulae by its own internal rules. Thus \verb?$x ( y + z )$?
and \verb?$x(y+z)$? both produce $x ( y + z )$. You can
also type carriage returns where necessary in your input file
(e.g., if you are typing in a complicated formula with many
Greek characters and funny symbols) and this will have no effect on
the final result if you are in mathematics mode.
\begin{quotation}
\footnotesize
To obtain the characters
$$\# \quad \$ \quad \% \quad \& \quad \_ \quad \{ \quad \}$$
in mathematics mode, one should type
\begin{verbatim}
\# \$ \% \& \_ \{ \} .
\end{verbatim}
To obtain $\backslash$ in mathematics mode, one may type
\verb?\backslash?.
\end{quotation}
\subsectiontitle{Subscripts and Superscripts}
Subscripts and superscripts are obtained using the special
characters \verb?_? and \verb?^? respectively. Thus the
expression $t^3 + x_1^2 - x_2$ is obtained by typing
\verb?$t^3 + x_1^2 - x_2$?. When the subscript or superscript
consists of more than one character then the characters involved
should be enclosed in curly brackets. Thus to obtain the
expression $u_{i,j}^{12}$ one would type
{\verb?$u_{i,j}^{12}$?}.
It is immaterial whether one specifies the subscript before the
superscript or vica versa. Thus \verb?$u_1^2$? and \verb?$u^2_1$?
both produce $u_1^2$. However \TeX\ does not like it if you type
\verb?$s_n_j$? since this could be interpreted either as
$s_{n j}$ or as $s_{n_j}$. The first of these alternatives is
obtained by typing \verb?$s_{n j}$?, the second by typing
\verb?$s_{n_j}$?. A similar remark applies to superscripts.
Incidentally, the second alternative illustrates the fact that
one can obtain subscripts (or superscripts) on subscripts
(or superscripts). However one should not go beyond this to
try to obtain triple subscripts.
\begin{quotation}
\footnotesize
It is sometimes necessary to obtain expressions such as
$R_i{}^j{}_{kl}$ in which the exact positioning of the subscripts
and superscripts is important (e.g., in papers on general relativity
and tensor analysis). The way this is done is to include the
`empty group' \verb?{}? at the appropriate places to enable the
superscripts and subscripts to be aligned correctly. Thus to
obtain $R_i{}^j{}_{kl}$ one would type
\verb?$R_i{}^j{}_{kl}$?.
\end{quotation}
\subsectiontitle{Greek Letters}
Greek letters are produced in mathematics mode by preceding the
name of the letter by a backslash \verb?\?. Thus the Greek letters
alpha~($\alpha$), pi~($\pi$) and chi~($\chi$) are obtained by
typing \verb?\alpha?,\verb?\pi? and \verb?\chi? respectively.
Thus the sentence
\begin{quotation}
\small
The area $A$ of a circle of radius $r$ is given by the
formula $A = \pi r^2$.
\end{quotation}
is obtained by typing
\begin{quote}
\begin{verbatim}
The area~$A$ of a circle of radius~$r$ is given by the
formula $A = \pi r^2$.
\end{verbatim}
\end{quote}
Upper case Greek letters are obtained by making the first character
of the name upper case. Thus $\Gamma$,$\Phi$ and $\Lambda$ are
obtained by typing \verb?\Gamma?,\verb?\Phi? and \verb?\Lambda?.
\begin{quotation}
\footnotesize
There is no special command for omicron: just use \verb?o?.
\end{quotation}
Some Greek letters occur in variant forms. The variant forms
are obtained by preceding the name of the Greek letter by `var'.
The following table lists the usual form of these letters and
the variant forms:-
{\def\displayandname#1{\rlap{$\displaystyle\csname #1\endcsname$}%
\qquad {\tt \char92 #1}}
$$\vcenter{\halign{\displayandname{#}\hfil&&\qquad
\displayandname{#}\hfil\cr
epsilon&varepsilon\cr
theta&vartheta\cr
pi&varpi\cr
rho&varrho\cr
sigma&varsigma\cr
phi&varphi\cr}}$$}
\subsectiontitle{Mathematical Symbols}
There are numerous mathematical symbols that can be used in
mathematics mode. These are obtained by typing an appropriate
control sequence. These are listed in Appendix~\ref{pl-mthcs}.
For example \verb?\neq?, \verb?\leq? and \verb?\geq? produce
$\neq$, $\leq$ and $\geq$ respectively, \verb?\infty? produces
$\infty$, \verb?\times? and \verb?\div? produce $\times$ and
$\div$, both \verb?\to? and \verb?\rightarrow? produce $\to$,
\verb?\in? produces $\in$, \verb?\cup?, \verb?\cap?,
\verb?\setminus? and \verb?\subset? produce $\cup$,$\cap$,
$\setminus$ and $\subset$ respectively. The list seems endless.
\subsectiontitle{Changing Fonts in Mathematics Mode}
One can change fonts in mathematics mode in exactly the same
way as when typesetting ordinary text. For instance \verb?\rm?
changes to the $\rm roman$ font, \verb?\bf? changes to the
$\bf boldface$ font and \verb?\mit? changes to the
$math$ $italic$ font. The $math$ $italic$ font is automatically
used in mathematics mode unless you explicitly change the font.
In addition there is a `calligraphic' font which is obtained using
the control sequence \verb?\cal?. {\it This font can only be used
for uppercase letters.} These calligraphic letters have the form
$$\cal ABCDEFGHIJKLMNOPQRSTUVWXYZ.$$
The following example shows how fonts are changed in an
example involving mathematics. To obtain
\begin{quotation}
\small
Let $\bf u$,$\bf v$ and $\bf w$ be three vectors in
${\bf R}^3$. The volume~$V$ of the parallelepiped with
corners at the points $\bf 0$,$\bf u$,$\bf v$,
$\bf w$,$\bf u+v$,$\bf u+w$,$\bf v+w$ and $\bf u+v+w$
is given by the formula
$$V = {\bf (u \times v) . w}.$$
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
Let $\bf u$,$\bf v$ and $\bf w$ be three vectors in
${\bf R}^3$. The volume~$V$ of the parallelepiped with
corners at the points $\bf 0$,$\bf u$,$\bf v$,
$\bf w$,$\bf u+v$,$\bf u+w$,$\bf v+w$ and $\bf u+v+w$
is given by the formula
$$V = {\bf (u \times v) . w}.$$
\end{verbatim}
\end{quote}
\subsectiontitle{Standard Functions and Embedded Text}
The names of certain standard functions and abbreviations are
obtained by typing a backlash \verb?\? before the name. The
complete list in \TeX\ is as follows:-
$$\vcenter{\halign{$\backslash${\tt #}&&\quad $\backslash${\tt #}\cr
arccos&cos&csc&exp&ker&limsup&min&sinh\cr
arcsin&cosh°&gcd&lg&ln&Pr&sup\cr
arctan&cot&det&hom&lim&log&sec&tan\cr
arg&coth&dim&inf&liminf&max&sin&tanh\cr}}$$
Names of functions and other abbreviations not in this list can be
obtained by converting to the roman font. Thus one obtains
${\rm Aut}(V)$ by typing \verb?${\rm Aut}(V)$?.
\begin{quotation}
\footnotesize
Note that if one were to type simply \verb?$Aut(V)$? one
would obtain $Aut(V)$, because \TeX\ has treated
\verb?Aut? as the product of three quantities $A$,$u$ and $t$ and
typeset the formula accordingly.
\end{quotation}
The recommended way to obtain ordinary text in displayed mathematical
formulae is to use \verb?\hbox?. Thus one obtains
$$M^\bot = \{ f \in V' : f(m) = 0 \hbox{ for all } m \in M \}.$$
by typing
\begin{quote}
\begin{verbatim}
$$M^\bot = \{ f \in V' : f(m) = 0 \hbox{ for all } m \in M \}.$$
\end{verbatim}
\end{quote}
Note the blank spaces before and after the words `for all' in the above
example. Had we typed
\begin{quote}
\begin{verbatim}
$$M^\bot = \{ f \in V' : f(m) = 0 \hbox{for all} m \in M \}.$$
\end{verbatim}
\end{quote}
we would have obtained
$$M^\bot = \{ f \in V' : f(m) = 0 \hbox{for all} m \in M \}.$$
\subsectiontitle{Fractions,Roots and Ellipsis}
Fractions of the form
$${\hbox{\it numerator} \over \hbox{\it denominator}}$$
are obtained in Plain \TeX\ using the construction
\begin{quote}
\verb?{?{\it numerator\verb? \over ?denominator}\verb?}?.
\end{quote}
For example, to obtain
\begin{quotation}
\small
The function $f$ is given by
$$f(x) = 2x + {x - 7 \over x^2 + 4}$$
for all real numbers $x$.
\end{quotation}
one would type
\begin{quote}
\begin{verbatim}
The function $f$ is given by
$$f(x) = 2x + {x - 7 \over x^2 + 4}$$
for all real numbers $x$.
\end{verbatim}
\end{quote}
To obtain square roots one uses the control sequence
\verb?\sqrt?. For example, $\sqrt{x^2 + y^2}$ is produced
by typing \verb?$\sqrt{x^2 + y^2}$?. To produce roots of
higher order in Plain \TeX\ one uses the construction
\begin{quote}
\verb?\root ?$n$\verb? \of ?{\it expression}
\end{quote}
to produce $\root n \of{\hbox{\it expression}}$. Thus typing
\verb?$\root 3 \of {x + 3y}$? produces
$\root 3 \of {x + 3y}$.
Ellipsis (three dots) is produced in mathematics mode using
the control sequences \verb?\cdots? and \verb?\ldots?. A
low ellipsis, such as $(x_1,x_2,\ldots ,x_n)$, is produced by
typing
\begin{quote}
\begin{verbatim}
$(x_1,x_2,\ldots ,x_n)$.
\end{verbatim}
\end{quote}
A centred ellipsis, such as $x_1 + x_2 + \cdots + x_n$ is produced
by typing
\begin{quote}
\begin{verbatim}
$x_1 + x_2 + \cdots + x_n$.
\end{verbatim}
\end{quote}
\subsectiontitle{Accents in Mathematics Mode}
The control sequences \verb?\underline?, \verb?\overline?,
\verb?\hat?, \verb?\check?, \verb?\tilde?, \verb?\acute?,
\verb?\grave?, \verb?\dot?, \verb?\ddot?, \verb?\breve?,
\verb?\bar? and \verb?\vec? produce underlining, overlining,
and various accents, {\it but only in mathematics mode}.
For example, $\tilde c$ is produced by \verb?$\tilde{c}$?.
The effect of these accents on the letter $a$ is shown in
the table below:
\begin{quote}
\begin{tabular}{ll}
\verb?$\underline{a}$? & $\underline{a}$\\
\verb?$\overline{a}$? & $\overline{a}$\\
\verb?$\hat{a}$? & $\hat{a}$\\
\verb?$\check{a}$? & $\check{a}$\\
\verb?$\tilde{a}$? & $\tilde{a}$\\
\verb?$\acute{a}$? & $\acute{a}$\\
\verb?$\grave{a}$? & $\grave{a}$\\
\verb?$\dot{a}$? & $\dot{a}$\\
\verb?$\ddot{a}$? & $\ddot{a}$\\
\verb?$\breve{a}$? & $\breve{a}$\\
\verb?$\bar{a}$? & $\bar{a}$\\
\verb?$\vec{a}$? & $\vec{a}$
\end{tabular}
\end{quote}
You should bear in mind that when a character is underlined in
a mathematical manuscript then it is normally typeset in
bold face without any underlining. Underlining is used very
rarely in print.
\begin{quotation}
\footnotesize
The control sequences such as \verb?\'? and \verb?\"?, used
to produce accents in ordinary text, may not be used in
mathematics mode.
\end{quotation}
\subsectiontitle{Brackets and Norms}
The frequently used left delimiters include $($, $[$ and $\{$,
which are obtained by typing \verb?(?, \verb?[? and \verb?\{?
respectively. The corresponding right delimiters are of
course $)$, $]$ and $\}$, obtained by typing \verb?)?,
\verb?]? and \verb?\}?. In addition $|$ and $\|$ are used as
both left and right delimiters, and are obtained by typing
\verb?|? and \verb?\|? respectively. For example, we obtain
\begin{quotation}
\small
Let $X$ be a Banach space and let $f \colon B \to {\bf R}$
be a bounded linear functional on $X$. The {\it norm} of
$f$, denoted by $\|f\|$, is defined by
$$\|f\| = \inf \{ K \in [0,+\infty) :
|f(x)| \leq K \|x\| \hbox{ for all } x \in X \}.$$
\end{quotation}
by typing
\begin{quote}
\begin{verbatim}
Let $X$ be a Banach space and let $f \colon B \to {\bf R}$
be a bounded linear functional on $X$. The {\it norm} of
$f$, denoted by $\|f\|$, is defined by
$$\|f\| = \inf \{ K \in [0,+\infty) :
|f(x)| \leq K \|x\| \hbox{ for all } x \in X \}.$$
\end{verbatim}
\end{quote}
Larger delimiters are sometimes required which have the
appropriate height to match the size of the subformula which
they enclose. Consider, for instance, the problem of typesetting
the following formula:
$$f(x,y,z) = 3y^2 z \left( 3 + {7x+5 \over 1 + y^2} \right).$$
The way to type the large parentheses is to type \verb?\left(?
for the left parenthesis and \verb?\right)? for the right
parenthesis, and let \TeX\ do the rest of the work for you.
Thus the above formula was obtained by typing
\begin{quote}
\begin{verbatim}
$$f(x,y,z) = 3y^2 z \left( 3 + {7x+5 \over 1 + y^2} \right).$$
\end{verbatim}
\end{quote}
If you type a delimiter which is preceded by \verb?\left? then
\TeX\ will search for a corresponding delimiter preceded by
\verb?\right? and calculate the size of the delimiters required
to enclose the intervening subformula. One is allowed to balance
a \verb?\left(? with a \verb?\right]? (say) if one desires: there
is no reason why the enclosing delimiters have to have the same
shape. One may also nest pairs of delimiters within one another:
by typing
\begin{quote}
\begin{verbatim}
$$\left| 4 x^3 + \left( x + {42 \over 1+x^4} \right) \right|.$$
\end{verbatim}
\end{quote}
we obtain
$$\left| 4 x^3 + \left( x + {42 \over 1+x^4} \right) \right|.$$
\begin{quotation}
\footnotesize
By typing \verb?\left.? and \verb?\right.? one obtains
{\it null delimiters} which are completely invisible. Consider,
for example, the problem of typesetting
$$\left. {du \over dx} \right|_{x=0}.$$
We wish to make the vertical bar big enough to match the
derivative preceding it. To do this, we suppose that the
derivative is enclosed by delimiters, where the left delimiter
is invisible and the right delimiter is the vertical line.
The invisible delimiter is produced using \verb?\left.? and thus
the whole formula is produced by typing
\begin{verbatim}
$$\left. {du \over dx} \right|_{x=0}.$$
\end{verbatim}
\end{quotation}
\newskip\plaincentering
\plaincentering=0pt plus 1000pt minus 1000pt
\def\eqalign#1{\null\,\vcenter{\openup\jot\mathsurround=0pt
\ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil
\crcr#1\crcr}}\,}
\newif\ifdtp
\def\mthdisplay{\global\dtptrue\openup\jot\mathsurround=0pt
\everycr{\noalign{\ifdtp \global\dtpfalse
\vskip-\lineskiplimit \vskip\normallineskiplimit
\else \penalty\interdisplaylinepenalty \fi}}}
\def\restindisp{\tabskip=0pt\everycr{}} % restore inside \mthdisplay
\def\displaylines#1{\mthdisplay
\halign{\hbox to\displaywidth{$\restindisp\hfil\displaystyle##\hfil$}\crcr
#1\crcr}}
\def\eqalignno#1{\mthdisplay \tabskip=\plaincentering
\halign to\displaywidth{\hfil$\restindisp\displaystyle{##}$\tabskip=0pt
&$\restindisp\displaystyle{{}##}$\hfil\tabskip=\plaincentering
&\llap{$\restindisp##$}\tabskip=0pt\crcr
#1\crcr}}
\def\leqalignno#1{\mthdisplay \tabskip=\plaincentering
\halign to\displaywidth{\hfil$\restindisp\displaystyle{##}$\tabskip=0pt
&$\restindisp\displaystyle{{}##}$\hfil\tabskip=\plaincentering
&\kern-\displaywidth\rlap{$\restindisp##$}\tabskip=\displaywidth\crcr
#1\crcr}}
\subsectiontitle{Multiline Formulae in Plain \TeX}
Consider the problem of typesetting the formula
$$\eqalign{\cos 2\theta &= \cos^2 \theta - \sin^2 \theta \cr
&= 2 \cos^2 \theta - 1.\cr}$$
It is necessary to ensure that the $=$ signs are aligned with one
another. The above example was obtained by typing
typing the lines
\begin{quote}
\begin{verbatim}
$$\eqalign{\cos 2\theta &= \cos^2 \theta - \sin^2 \theta \cr
&= 2 \cos^2 \theta - 1.\cr}$$
\end{verbatim}
\end{quote}
Note the use of the special character \verb?&? as an {it alignment
tab}. When the formula is typeset, the part of the second line of
the formula beginning with an occurrence of \verb?&? will be
placed immediately beneath that part of the first line of the
formula which begins with the corresponding occurrence of \verb?&?.
Also the control sequence \verb?\cr? is placed at the end of each
line of the formula.
Although we have placed corresponding occurrences of \verb?&?
beneath one another in the above example, it is not necessary to
do this in the input file. It was done in the above example merely
to improve the appearance (and readability) of the input file.
The more complicated example
\begin{quotation}
\small
If $h \leq {1 \over 2} |\zeta - z|$ then
$$|\zeta - z - h| \geq {1 \over 2} |\zeta - z|$$
and hence
$$\eqalign{
\left| {1 \over \zeta - z - h} - {1 \over \zeta - z} \right|
& = \left|
{(\zeta - z) - (\zeta - z - h) \over (\zeta - z - h)(\zeta - z)}
\right| \cr & =
\left| {h \over (\zeta - z - h)(\zeta - z)} \right| \cr
& \leq {2 |h| \over |\zeta - z|^2}.\cr}$$
\end{quotation}
was obtained by typing
\begin{quote}
\begin{verbatim}
If $h \leq {1 \over 2} |\zeta - z|$ then
$$|\zeta - z - h| \geq {1 \over 2} |\zeta - z|$$
and hence
$$\eqalign{
\left| {1 \over \zeta - z - h} - {1 \over \zeta - z} \right|
& = \left|
{(\zeta - z) - (\zeta - z - h) \over (\zeta - z - h)(\zeta - z)}
\right| \cr & =
\left| {h \over (\zeta - z - h)(\zeta - z)} \right| \cr
& \leq {2 |h| \over |\zeta - z|^2}.\cr}$$
\end{verbatim}
\end{quote}
Numbered multiline formulae are produced using the control
sequence \verb?\eqalignno?. This works exactly like
\verb?\eqalign?, but on each line for which you want an
equation number you insert `\verb?&?{\it equation number}'
immediately before the \verb?\cr?. Thus typing
\begin{quote}
\begin{verbatim}
$$\eqalignno{\sin 2\theta &= 2\sin \theta \cos \theta,&(6)\cr
\cos 2\theta &= \cos^2 \theta - \sin^2 \theta \cr
&= 2 \cos^2 \theta - 1.&(7)\cr}$$
\end{verbatim}
\end{quote}
produces
$$\eqalignno{\sin 2\theta &= 2\sin \theta \cos \theta,&(6)\cr
\cos 2\theta &= \cos^2 \theta - \sin^2 \theta \cr
&= 2 \cos^2 \theta - 1.&(7)\cr}$$
It is occasionally necessary to produce formulae such as
$$|x| = \cases{ x &if $x \geq 0$;\cr
-x &if $x < 0$.\cr}$$
We use the control sequence \verb?\cases?. The above formula is
obtained by typing
\begin{quote}
\begin{verbatim}
$$|x| = \cases{ x &if $x \geq 0$;\cr
-x &if $x < 0$.\cr}$$
\end{verbatim}
\end{quote}
Note the use of the alignment tab \verb?&?. Also note that the
expression to the left of the alignment tab \verb?&? is a
mathematical expression, processed in mathematics mode, whereas
the expression to the right of the alignment tab \verb?&? is
treated as ordinary text. Thus one must place \verb?$? before and
after any mathematical expression occurring to the right of the
alignment tab \verb?&?. Note also the use of \verb?\cr? at the
end of each line on the right hand side of the equation.
\subsectiontitle{Matrices and other arrays in Plain \TeX}
Matrices and other arrays are produced in Plain \TeX\ using the
control sequences \verb?\matrix? and \verb?\pmatrix?. For example,
suppose that we wish to typeset the following passage:
\begin{quotation}
\small
The {\it characteristic polynomial} $\chi(\lambda)$ of the
$3 \times 3$~matrix
$$\left( \matrix{ a & b & c \cr
d & e & f \cr
g & h & i \cr} \right)$$
is given by the formula
$$\chi(\lambda) = \left| \matrix{
\lambda - a & -b & -c \cr
-d & \lambda - e & -f \cr
-g & -h & \lambda - i \cr} \right|.$$
\end{quotation}
This passage is produced by the following input:
\begin{quote}
\begin{verbatim}
The {\it characteristic polynomial} $\chi(\lambda)$ of the
$3 \times 3$~matrix
$$\left( \matrix{ a & b & c \cr
d & e & f \cr
g & h & i \cr} \right)$$
is given by the formula
$$\chi(\lambda) = \left| \matrix{
\lambda - a & -b & -c \cr
-d & \lambda - e & -f \cr
-g & -h & \lambda - i \cr} \right|.$$
\end{verbatim}
\end{quote}
First of all, note the use of \verb?\left? and \verb?\right?
to produce the large delimiters around the arrays. As we have
already seen, if we use
$$\hbox{\verb?\left(?} \qquad \ldots \qquad
\hbox{\verb?\right)?}$$
then the size of the parentheses is chosen to match the subformula
that they enclose. Next note the use of the alignment tab
character \verb?&? to separate the entries of the matrix and
the use of \verb?\cr? at the end of each row of the matrix, exactly
as in the construction of multiline formulae described above.
Since matrices delimited by parentheses are common, Plain
\TeX\ provides the control sequence \verb?\pmatrix? to
construct them. Thus
$$\pmatrix{\lambda - a & -b & -c \cr
-d & \lambda - e & -f \cr
-g & -h & \lambda - i \cr}.$$
may be obtained by typing
\begin{quote}
\begin{verbatim}
$$\pmatrix{\lambda - a & -b & -c \cr
-d & \lambda - e & -f \cr
-g & -h & \lambda - i \cr}.$$
\end{verbatim}
\end{quote}
Note that \verb?\pmatrix? behaves exactly like \verb?\matrix?,
except that there is no need to use \verb?\left(? and
\verb?\right)? to produce the parentheses around the matrix,
since these are automatically produced by \verb?\pmatrix?.
More complicated arrays can be produced in Plain \TeX\ with
comparative ease using \verb?\halign? (see Chapter 22 of
the \TeX book).
\subsectiontitle{Derivatives, Limits, Sums and Integrals}
The expressions
$${du \over dt} \hbox{ and } {d^2 u \over dx^2}$$
are obtained by typing \verb?{du \over dt}?
and \verb?{d^2 u \over dx^2}? respectively. The mathematical
symbol $\partial$ is produced using \verb?\partial?. Thus to obtain
partial derivatives such as
$${\partial u \over \partial t} \hbox{ and }
{\partial^2 u \over \partial x^2}$$
one types \verb?{\partial u \over \partial t}? and
\verb?{\partial^2 u \over \partial x^2}? respectively.
To obtain mathematical expressions such as
$$\lim_{x \to +\infty} \hbox{, } \inf_{x > s} \hbox{ and } \sup_K$$
in displayed equations we type \verb?\lim_{x \to +\infty}?,
\verb?\inf_{x > s}? and \verb?\sup_K? respectively. Thus to obtain
$$\lim_{x \to 0} {3x^2 +7 \over x^2 +1} = 3.$$
we type
\begin{quote}
\begin{verbatim}
$$\lim_{x \to 0} {3x^2 +7x^3 \over x^2 +5x^4} = 3.$$
\end{verbatim}
\end{quote}
To obtain a summation sign such as
$$\sum_{i=1}^{2n}$$
we type \verb?\sum_{i=1}^{2n}?. Thus
$$\sum_{k=1}^n k^2 = {1 \over 2} n (n+1).$$
is obtained by typing
\begin{quote}
\begin{verbatim}
$$\sum_{k=1}^n k^2 = {1 \over 2} n (n+1).$$
\end{verbatim}
\end{quote}
We now discuss how to obtain {\it integrals} in mathematical
documents. A typical integral is the following:
$$\int_a^b f(x)\,dx.$$
This is typeset using
\begin{quote}
\begin{verbatim}
$$\int_a^b f(x)\,dx.$$
\end{verbatim}
\end{quote}
The integral sign $\int$ is typeset using the control sequence
\verb?\int?, and the {\it limits of integration} (in this case
$a$ and $b$) are treated as a subscript and a superscript on the
integral sign. It remains to describe the purpose of the \verb?\,?
occurring immediately before the \verb?dx?. This is the means of telling
\TeX\ to put extra space before the $d$. This is necessary to
produce the correct appearance.
Most integrals occurring in mathematical documents begin with
an integral sign and contain one or more instances of \verb?d?
followed by another (Latin or Greek) letter, as in $dx$, $dt$,
and $d\theta$. To obtain the correct appearance one should put
extra space before the $d$, using \verb?\,?. Thus
$$\int_0^{+\infty} x^n e^{-x} \,dx = n!.$$
$$\int \cos \theta \,d\theta = \sin \theta.$$
$$\int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta.$$
and
$$\int_0^R {2x\,dx \over 1+x^2} = \log(1+R^2).$$
are obtained by typing
\begin{quote}
\begin{verbatim}
$$\int_0^{+\infty} x^n e^{-x} \,dx = n!.$$
\end{verbatim}
\end{quote}
\begin{quote}
\begin{verbatim}
$$\int \cos \theta \,d\theta = \sin \theta.$$
\end{verbatim}
\end{quote}
\begin{quote}
\begin{verbatim}
$$\int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta.$$
\end{verbatim}
\end{quote}
and
\begin{quote}
\begin{verbatim}
$$\int_0^R {2x\,dx \over 1+x^2} = \log(1+R^2).$$
\end{verbatim}
\end{quote}
respectively.
In some multiple integrals (i.e., integrals containing more than
one integral sign) one finds that \TeX\ puts too much space
between the integral signs. The way to improve the appearance of
of the integral is to use the control sequence \verb?\!? to
remove a thin strip of unwanted space. Thus, for example, the
multiple integral
$$\int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.$$
is obtained by typing
\begin{quote}
\begin{verbatim}
$$\int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.$$
\end{verbatim}
\end{quote}
Had we typed
\begin{quote}
\begin{verbatim}
$$\int_0^1 \int_0^1 x^2 y^2\,dx\,dy.$$
\end{verbatim}
\end{quote}
we would have obtained
$$\int_0^1 \int_0^1 x^2 y^2\,dx\,dy.$$
A particularly noteworthy example comes when we are
typesetting a multiple integral such as
$$\int \!\!\! \int_D f(x,y)\,dx\,dy.$$
Here we use \verb?\!? three times to obtain suitable spacing
between the integral signs. We typeset this integral using
\begin{quote}
\begin{verbatim}
$$\int \!\!\! \int_D f(x,y)\,dx\,dy.$$
\end{verbatim}
\end{quote}
Had we typed
\begin{quote}
\begin{verbatim}
$$\int \int_D f(x,y)\,dx\,dy.$$
\end{verbatim}
\end{quote}
we would have obtained
$$\int \int_D f(x,y)\,dx\,dy.$$
The following (reasonably complicated) passage exhibits a
number of the features which we have been discussing:
\begin{quotation}
\small
In non-relativistic wave mechanics, the wave function
$\psi({\bf r},t)$ of a particle satisfies the
{\it Schr\"{o}dinger Wave Equation}
$$i\hbar{\partial \psi \over \partial t}
= {-\hbar^2 \over 2m} \left(
{\partial^2 \over \partial x^2}
+ {\partial^2 \over \partial y^2}
+ {\partial^2 \over \partial z^2}
\right) \psi + V \psi.$$
It is customary to normalize the wave equation by
demanding that
$$\int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},0) \right|^2\,dx\,dy\,dz = 1.$$
A simple calculation using the Schr\"{o}dinger wave
equation shows that
$${d \over dt} \int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz = 0,$$
and hence
$$\int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz = 1$$
for all times~$t$. If we normalize the wave function in this
way then, for any (measurable) subset~$V$ of ${\bf R}^3$ and
time~$t$,
$$\int \!\!\! \int \!\!\! \int_V
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz$$
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
\end{quotation}
One would typeset this in Plain \TeX\ by typing
\begin{quote}
\begin{verbatim}
In non-relativistic wave mechanics, the wave function
$\psi({\bf r},t)$ of a particle satisfies the
{\it Schr\"{o}dinger Wave Equation}
$$i\hbar{\partial \psi \over \partial t}
= {-\hbar^2 \over 2m} \left(
{\partial^2 \over \partial x^2}
+ {\partial^2 \over \partial y^2}
+ {\partial^2 \over \partial z^2}
\right) \psi + V \psi.$$
It is customary to normalize the wave equation by
demanding that
$$\int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},0) \right|^2\,dx\,dy\,dz = 1.$$
A simple calculation using the Schr\"{o}dinger wave
equation shows that
$${d \over dt} \int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz = 0,$$
and hence
$$\int \!\!\! \int \!\!\! \int_{{\bf R}^3}
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz = 1$$
for all times~$t$. If we normalize the wave function in this
way then, for any (measurable) subset~$V$ of ${\bf R}^3$ and
time~$t$,
$$\int \!\!\! \int \!\!\! \int_V
\left| \psi({\bf r},t) \right|^2\,dx\,dy\,dz$$
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
\end{verbatim}
\end{quote}