diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/tcdmanual/la_math.tex |
Initial commit
Diffstat (limited to 'info/tcdmanual/la_math.tex')
-rw-r--r-- | info/tcdmanual/la_math.tex | 897 |
1 files changed, 897 insertions, 0 deletions
diff --git a/info/tcdmanual/la_math.tex b/info/tcdmanual/la_math.tex new file mode 100644 index 0000000000..464a374e1d --- /dev/null +++ b/info/tcdmanual/la_math.tex @@ -0,0 +1,897 @@ +\sectiontitle{Mathematical Formulae using \LaTeX} +\label{la-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. + +\begin{quotation} +\footnotesize +\LaTeX\ also allows you to use \verb?\(? and \verb?\)? to mark +the beginning and the end respectively of a mathematical formula +embedded in text. Thus +\begin{quote} +Let \( f \) be the function defined by \( f(x) = 3x + 7 \). +\end{quote} +may be produced by typing +\begin{quote} +\begin{verbatim} +Let \( f \) be the function defined by \( f(x) = 3x + 7 \). +\end{verbatim} +\end{quote} +However this use of \verb?\(?$\ldots$\verb?\)? is only permitted +in \LaTeX, whereas \verb?$?$\ldots$\verb?$? is more standard, and is +used in other dialects of \TeX, such as Plain \TeX\ and \AmSTeX. +\end{quotation} + + In order to obtain an mathematical formula or equation which +is displayed on a line by itself, one places \verb?\[? before and +\verb?\]? 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} + +\begin{quotation} +\footnotesize +It is also possible to use \verb?$$? in place of both \verb?\[ ? +and \verb?\]? to mark the beginning and end of a displayed +mathematical equation. Thus +$$f(x)g(x) = 3x^2 + 19x +28.$$ +can be produced by typing +\begin{quote} +\begin{verbatim} +$$f(x)g(x) = 3x^2 + 19x +28.$$ +\end{verbatim} +\end{quote} +Indeed this the method of producing displayed equations in +dialects of \TeX\ other than \LaTeX, such as Plain \TeX\ and +\AmSTeX. +\end{quotation} + + \LaTeX\ provides facilities for the automatic numbering of +displayed equations. If you want an numbered equation then you +use \verb?\begin{equation}? and \verb?\end{equation}? instead +of using \verb?\[ ? and \verb?\]? . Thus +\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 +\begin{equation} +f(x)g(x) = 3x^2 + 19x +28. +\end{equation} +\end{verbatim} +\end{quote} +produces +\begin{quote} +The product of two first degree polynomials is a quadratic +polynomial. For example, if $f(x) = 3x + 7$ and $g(x) = x + 4$ +then +\begin{equation} +f(x)g(x) = 3x^2 + 19x +28. +\end{equation} +\end{quote} + +\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{la-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} +\ifx\selectfont\undefined +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 +\else +The $math$ $italic$ font is automatically +used in mathematics mode unless you explicitly change the font. +The rules for changing the font in mathematics mode are rather different +to those applying when typesetting ordinary text. +Firstly, any change only applies to the single character +or symbol that follows. +Secondly, to change a character to the +$\mathrm{r}\mathrm{o}\mathrm{m}\mathrm{a}\mathrm{n}$ font, +the control sequence \verb?\mathrm? must be used +(rather than \verb?\rm?). +Thirdly to change a character to the +$\boldsymbol{b}\boldsymbol{o}\boldsymbol{l}\boldsymbol{d}% +\boldsymbol{f}\boldsymbol{a}\boldsymbol{c}\boldsymbol{e}$ +font the control sequence \verb?\boldsymbol? must be used, +{\em and in addition the \verb?amsbsy? style must be included +in the \verb?\documentstyle? heading}. + +There is also a `calligraphic' font available in mathematics mode. +This is obtained using the control sequence \verb?\cal?. +{\it This font can only be used for uppercase letters.} +These calligraphic letters have the form +\fi +\[ \cal{A}\cal{B}\cal{C}\cal{D}\cal{E}\cal{F}\cal{G}\cal{H}\cal{I} +\cal{J}\cal{K}\cal{L}\cal{M}\cal{N}\cal{O}\cal{P}\cal{Q}\cal{R} +\cal{S}\cal{T}\cal{U}\cal{V}\cal{W}\cal{X}\cal{Y}\cal{Z}. \] + + The following example shows how fonts are changed in an +example involving mathematics. To obtain +\ifx\selectfont\undefined +\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}+{\bf v}$, +${\bf u}+{\bf w}$,${\bf v}+{\bf w}$ +and ${\bf u}+{\bf v}+{\bf w}$ +is given by the formula +\[ V = ({\bf u} \times {\bf v}) \cdot {\bf 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}+{\bf v}$, +${\bf u}+{\bf w}$,${\bf v}+{\bf w}$ +and ${\bf u}+{\bf v}+{\bf w}$ +is given by the formula +\[ V = ({\bf u} \times {\bf v}) . {\bf w}. \] +\end{verbatim} +\end{quote} +\else +\begin{quotation} +\small +Let $\boldsymbol u$,$\boldsymbol v$ and $\boldsymbol w$ be three vectors in +${\boldsymbol R}^3$. The volume~$V$ of the parallelepiped with +corners at the points $\boldsymbol{0}$,$\boldsymbol{u}$,$\boldsymbol{v}$, +$\boldsymbol{w}$,$\boldsymbol{u}+\boldsymbol{v}$, +$\boldsymbol{u}+\boldsymbol{w}$,$\boldsymbol{v}+\boldsymbol{w}$ +and $\boldsymbol{u}+\boldsymbol{v}+\boldsymbol{w}$ +is given by the formula +\[ V = (\boldsymbol{u} \times \boldsymbol{v}) \cdot \boldsymbol{w}. \] +\end{quotation} +one would type +\begin{quote} +\begin{verbatim} +Let $\boldsymbol u$,$\boldsymbol v$ and $\boldsymbol w$ be three vectors +in ${\boldsymbol R}^3$. The volume~$V$ of the parallelepiped with corners +at the points $\boldsymbol{0}$,$\boldsymbol{u}$,$\boldsymbol{v}$, +$\boldsymbol{w}$,$\boldsymbol{u}+\boldsymbol{v}$, +$\boldsymbol{u}+\boldsymbol{w}$,$\boldsymbol{v}+\boldsymbol{w}$ +and $\boldsymbol{u}+\boldsymbol{v}+\boldsymbol{w}$ +is given by the formula +\[ V = (\boldsymbol{u} \times \boldsymbol{v}) . \boldsymbol{w}. \] +\end{verbatim} +\end{quote} +\fi + +\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?\mbox?. Thus one obtains +\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{ for all } m \in M \}. \] +by typing +\begin{quote} +\begin{verbatim} +\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{ 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 \mbox{for all} m \in M \}. \] +\end{verbatim} +\end{quote} +we would have obtained +\[ M^\bot = \{ f \in V' : f(m) = 0 \mbox{for all} m \in M \}. \] + +\begin{quotation} +\footnotesize +One can use \verb?\hbox? as an alternative to \verb?\mbox? in +mathematical formulae. Indeed \verb?\mbox? is specific to +\LaTeX, whereas \verb?\hbox? is used in Plain \TeX\ and in +other dialects of \TeX. Also \verb?\hbox? and \verb?\mbox? +only differ in their behaviour when used to begin a paragraph +of ordinary text, and in particular behave in an identical +manner when used in a mathematical formula. +\end{quotation} + +\subsectiontitle{Fractions,Roots and Ellipsis} +Fractions of the form +\[ \frac{\mbox{\it numerator}}{\mbox{\it denominator}} \] +are obtained in \LaTeX\ using the construction +\begin{quote} +\verb?\frac{?{\it numerator\verb?}{?denominator}\verb?}?. +\end{quote} +For example, to obtain +\begin{quotation} +\small +The function $f$ is given by +\[ f(x) = 2x + \frac{x - 7}{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 + \frac{x - 7}{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}$?. In \LaTeX, an $n$th +root is produced using +\begin{quote} +\verb?\sqrt[n]{?{\it expression}\verb?}?. +\end{quote} +Thus $\sqrt[3]{x + 3y}$ is produced in \LaTeX\ by typing +\verb?$\sqrt[3]{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\| \mbox{ 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\| \mbox{ 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 + \frac{7x+5}{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 + \frac{7x+5}{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 + \frac{42}{1+x^4} \right) \right|. \] +\end{verbatim} +\end{quote} +we obtain +\[ \left| 4 x^3 + \left( x + \frac{42}{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. \frac{du}{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. \frac{du}{dx} \right|_{x=0}. \] +\end{verbatim} +\end{quotation} + +\subsectiontitle{Multiline Formulae in \LaTeX} +Consider the problem of typesetting the formula +\begin{eqnarray*} +\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\ + & = & 2 \cos^2 \theta - 1. +\end{eqnarray*} +It is necessary to ensure that the $=$ signs are aligned with one +another. In \LaTeX, such a formula is typeset using the +\verb?eqnarray*? environment. The above example was obtained by +typing the lines +\begin{quote} +\begin{verbatim} +\begin{eqnarray*} +\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\ + & = & 2 \cos^2 \theta - 1. +\end{eqnarray*} +\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 \verb?\\? is used to separate the lines 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 \frac{1}{2} |\zeta - z|$ then +\[ |\zeta - z - h| \geq \frac{1}{2} |\zeta - z| \] +and hence +\begin{eqnarray*} +\left| \frac{1}{\zeta - z - h} - \frac{1}{\zeta - z} \right| +& = & \left| +\frac{(\zeta - z) - (\zeta - z - h)}{(\zeta - z - h)(\zeta - z)} +\right| \\ & = & +\left| \frac{h}{(\zeta - z - h)(\zeta - z)} \right| \\ + & \leq & \frac{2 |h|}{|\zeta - z|^2}. +\end{eqnarray*} +\end{quotation} +was obtained by typing +\begin{quote} +\begin{verbatim} +If $h \leq \frac{1}{2} |\zeta - z|$ then +\[ |\zeta - z - h| \geq \frac{1}{2} |\zeta - z| \] +and hence +\begin{eqnarray*} +\left| \frac{1}{\zeta - z - h} - \frac{1}{\zeta - z} \right| +& = & \left| +\frac{(\zeta - z) - (\zeta - z - h)}{(\zeta - z - h)(\zeta - z)} +\right| \\ & = & +\left| \frac{h}{(\zeta - z - h)(\zeta - z)} \right| \\ + & \leq & \frac{2 |h|}{|\zeta - z|^2}. +\end{eqnarray*} +\end{verbatim} +\end{quote} + + The asterisk in \verb?eqnarray*? is put there to suppress the +automatic equation numbering produced by \LaTeX. If you wish for +an automatically numbered multiline formula, you should use +\verb?\begin{eqnarray}? and \verb?\end{eqnarray}?. + +\subsectiontitle{Matrices and other arrays in \LaTeX} +Matrices and other arrays are produced in \LaTeX\ using the +{\bf array} environment. For example, suppose that we wish to +typeset the following passage: +\begin{quotation} +\small +The {\em characteristic polynomial} $\chi(\lambda)$ of the +$3 \times 3$~matrix +\[ \left( \begin{array}{ccc} +a & b & c \\ +d & e & f \\ +g & h & i \end{array} \right) \] +is given by the formula +\[ \chi(\lambda) = \left| \begin{array}{ccc} +\lambda - a & -b & -c \\ +-d & \lambda - e & -f \\ +-g & -h & \lambda - i \end{array} \right|. \] +\end{quotation} +This passage is produced by the following input: +\begin{quote} +\begin{verbatim} +The {\em characteristic polynomial} $\chi(\lambda)$ of the +$3 \times 3$~matrix +\[ \left( \begin{array}{ccc} +a & b & c \\ +d & e & f \\ +g & h & i \end{array} \right) \] +is given by the formula +\[ \chi(\lambda) = \left| \begin{array}{ccc} +\lambda - a & -b & -c \\ +-d & \lambda - e & -f \\ +-g & -h & \lambda - i \end{array} \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?\\? to separate the rows of the matrix, exactly +as in the construction of multiline formulae described above. +We begin the array with \verb?\begin{array}? and end it with +\verb?\end{array}?. The only thing left to explain, therefore, +is the mysterious \verb?{ccc}? which occurs immediately after +\verb?\begin{array}?. + Now each of the \verb?c?'s in \verb?{ccc}? represents a +column of the matrix and indicates that the entries of the +column should be {\em centred}. If the \verb?c? were replaced by +\verb?l? then the corresponding column would be typeset with +all the entries flush {\em left}, and \verb?r? would produce a +column with all entries flush {\em right}. Thus +\begin{quote} +\begin{verbatim} +\[ \begin{array}{lcr} +\mbox{First number} & x & 8 \\ +\mbox{Second number} & y & 15 \\ +\mbox{Sum} & x + y & 23 \\ +\mbox{Difference} & x - y & -7 \\ +\mbox{Product} & xy & 120 \end{array} \] +\end{verbatim} +\end{quote} +produces +\begin{quotation} +\small +\[ \begin{array}{lcr} +\mbox{First number} & x & 8 \\ +\mbox{Second number} & y & 15 \\ +\mbox{Sum} & x + y & 23 \\ +\mbox{Difference} & x - y & -7 \\ +\mbox{Product} & xy & 120 \end{array} \] +\end{quotation} + + We can use the array environment to produce formulae such as +\[ |x| = \left\{ \begin{array}{ll} + x & \mbox{if $x \geq 0$};\\ + -x & \mbox{if $x < 0$}.\end{array} \right. \] +Note that both columns of this array are set flush left. Thus we +use \verb?{ll}? immediately after \verb?\begin{array}?. The large +curly bracket is produced using \verb?\left\{?. However this +requires a corresponding \verb?\right? delimiter to match it. +We therefore use the {\em null delimiter} \verb?\right.? +discussed earlier. This delimiter is invisible. We can +therefore obtain the above formula by typing +\begin{quote} +\begin{verbatim} +\[ |x| = \left{ \begin{array}{ll} + x & \mbox{if $x \geq 0$};\\ + -x & \mbox{if $x < 0$}.\end{array} \right. \] +\end{verbatim} +\end{quote} + +\subsectiontitle{Derivatives, Limits, Sums and Integrals} +The expressions +\[ \frac{du}{dt} \mbox{ and } \frac{d^2 u}{dx^2} \] +are obtained in \LaTeX\ by typing \verb?\frac{du}{dt}? +and \verb?\frac{d^2 u dx^2}? respectively. The mathematical +symbol $\partial$ is produced using \verb?\partial?. Thus +partial derivatives such as +$\displaystyle\frac{\partial u}{\partial t}$ and +$\displaystyle\frac{\partial^2 u}{\partial x^2}$ are obtained +in \LaTeX\ by typing +\begin{quote} +\verb?\frac{\partial u}{\partial t}? and +\verb?\frac{\partial^2 u}{\partial x^2}?. +\end{quote} + +To obtain mathematical expressions such as +\[ \lim_{x \to +\infty} \mbox{, } \inf_{x > s} \mbox{ 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} \frac{3x^2 +7}{x^2 +1} = 3. \] +(in \LaTeX) we type +\begin{quote} +\begin{verbatim} +\[ \lim_{x \to 0} \frac{3x^2 +7x^3}{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 = \frac{1}{2} n (n+1). \] +is obtained by typing +\begin{quote} +\begin{verbatim} +\[ \sum_{k=1}^n k^2 = \frac{1}{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 \frac{2x\,dx}{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 \frac{2x\,dx}{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\frac{\partial \psi}{\partial t} + = \frac{-\hbar^2}{2m} \left( + \frac{\partial^2}{\partial x^2} + + \frac{\partial^2}{\partial y^2} + + \frac{\partial^2}{\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 +\[ \frac{d}{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 \LaTeX\ 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\frac{\partial \psi}{\partial t} + = \frac{-\hbar^2}{2m} \left( + \frac{\partial^2}{\partial x^2} + + \frac{\partial^2}{\partial y^2} + + \frac{\partial^2}{\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 +\[ \frac{d}{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} + |