## Chapter 2Math examples

2.1 Delimiters
2.2 Spacing
2.3 Arrays

2.5 Functions
2.6 Accents

These examples were copied from www.maths.adelaide.edu.au/. Math was converted to mathml, Mathjax is used to render it in browsers without mathml support.

### 2.1 Delimiters

See how the delimiters are of reasonable size in these examples

$\left(a+b\right)\left[1-\frac{b}{a+b}\right]=a\phantom{\rule{0.3em}{0ex}},$

$\sqrt{|xy|}\le \left|\frac{x+y}{2}\right|,$

even when there is no matching delimiter

${\int }_{a}^{b}u\frac{{d}^{2}v}{d{x}^{2}}\phantom{\rule{0.3em}{0ex}}dx={u\frac{dv}{dx}|}_{a}^{b}-{\int }_{a}^{b}\frac{du}{dx}\frac{dv}{dx}\phantom{\rule{0.3em}{0ex}}dx.$

### 2.2 Spacing

Diﬀerentials often need a bit of help with their spacing as in

$\iint x{y}^{2}\phantom{\rule{0.3em}{0ex}}dx\phantom{\rule{0.3em}{0ex}}dy=\frac{1}{6}{x}^{2}{y}^{3},$

whereas vector problems often lead to statements such as

$u=\frac{-y}{{x}^{2}+{y}^{2}}\phantom{\rule{0.3em}{0ex}},\phantom{\rule{1em}{0ex}}v=\frac{x}{{x}^{2}+{y}^{2}}\phantom{\rule{0.3em}{0ex}},\phantom{\rule{1em}{0ex}}\text{and}\phantom{\rule{1em}{0ex}}w=0\phantom{\rule{0.3em}{0ex}}.$

### 2.3 Arrays

Arrays of mathematics are typeset using one of the matrix environments as in

$\left[\begin{array}{ccc}\hfill 1\hfill & \hfill x\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill -1\hfill \end{array}\right]\left[\begin{array}{c}\hfill 1\hfill \\ \hfill y\hfill \\ \hfill 1\hfill \end{array}\right]=\left[\begin{array}{c}\hfill 1+xy\hfill \\ \hfill y-1\hfill \end{array}\right].$

Case statements use cases:

Many arrays have lots of dots all over the place as in

$\begin{array}{cccccc}\hfill -2\hfill & \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill \cdots \hfill & \hfill 0\hfill \\ \hfill 1\hfill & \hfill -2\hfill & \hfill 1\hfill & \hfill 0\hfill & \hfill \cdots \hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill -2\hfill & \hfill 1\hfill & \hfill \cdots \hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill & \hfill -2\hfill & \hfill \ddots \hfill & \hfill ⋮\hfill \\ \hfill ⋮\hfill & \hfill ⋮\hfill & \hfill ⋮\hfill & \hfill \ddots \hfill & \hfill \ddots \hfill & \hfill 1\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0\hfill & \hfill \cdots \hfill & \hfill 1\hfill & \hfill -2\hfill \end{array}$

### 2.4 Equation arrays

In the ﬂow of a ﬂuid ﬁlm we may report

$\begin{array}{rcll}{u}_{\alpha }& =& {𝜖}^{2}{\kappa }_{xxx}\left(y-\frac{1}{2}{y}^{2}\right),& \text{(2.1)}\text{}\text{}\\ v& =& {𝜖}^{3}{\kappa }_{xxx}y\phantom{\rule{0.3em}{0ex}},& \text{(2.2)}\text{}\text{}\\ p& =& 𝜖{\kappa }_{xx}\phantom{\rule{0.3em}{0ex}}.& \text{(2.3)}\text{}\text{}\end{array}$

Alternatively, the curl of a vector ﬁeld $\left(u,v,w\right)$ may be written with only one equation number:

$\begin{array}{rcll}{\omega }_{1}& =& \frac{\partial w}{\partial y}-\frac{\partial v}{\partial z}\phantom{\rule{0.3em}{0ex}},& \text{}\\ {\omega }_{2}& =& \frac{\partial u}{\partial z}-\frac{\partial w}{\partial x}\phantom{\rule{0.3em}{0ex}},& \text{(2.4)}\text{}\text{}\\ {\omega }_{3}& =& \frac{\partial v}{\partial x}-\frac{\partial u}{\partial y}\phantom{\rule{0.3em}{0ex}}.& \text{}\end{array}$

Whereas a derivation may look like

### 2.5 Functions

Observe that trigonometric and other elementary functions are typeset properly, even to the extent of providing a thin space if followed by a single letter argument:

$exp\left(i𝜃\right)=cos𝜃+isin𝜃\phantom{\rule{0.3em}{0ex}},\phantom{\rule{1em}{0ex}}sinh\left(logx\right)=\frac{1}{2}\left(x-\frac{1}{x}\right).$

With sub- and super-scripts placed properly on more complicated functions,

$\underset{q\to \infty }{lim}\parallel f\left(x\right){\parallel }_{q}=\underset{x}{max}|f\left(x\right)|,$

and large operators, such as integrals and

In inline mathematics the scripts are correctly placed to the side in order to conserve vertical space, as in $1∕\left(1-x\right)={\sum }_{n=0}^{\infty }{x}^{n}.$

### 2.6 Accents

Mathematical accents are performed by a short command with one argument, such as

$\stackrel{̃}{f}\left(\omega \right)=\frac{1}{2\pi }{\int }_{-\infty }^{\infty }f\left(x\right){e}^{-i\omega x}\phantom{\rule{0.3em}{0ex}}dx\phantom{\rule{0.3em}{0ex}},$

or

$\stackrel{̇}{\stackrel{\to }{\omega }}=\stackrel{\to }{r}×\stackrel{\to }{I}\phantom{\rule{0.3em}{0ex}}.$

### 2.7 Command deﬁnition

The Airy function, $Ai\left(x\right)$, may be incorrectly deﬁned as this integral

$Ai\left(x\right)=\int exp\left({s}^{3}+isx\right)\phantom{\rule{0.3em}{0ex}}ds\phantom{\rule{0.3em}{0ex}}.$

This vector identity serves nicely to illustrate two of the new commands:

$\text{}\nabla \text{}×\text{}q\text{}=\text{}i\text{}\left(\frac{\partial w}{\partial y}-\frac{\partial v}{\partial z}\right)+\text{}j\text{}\left(\frac{\partial u}{\partial z}-\frac{\partial w}{\partial x}\right)+\text{}k\text{}\left(\frac{\partial v}{\partial x}-\frac{\partial u}{\partial y}\right).$

### 2.8 Theorems et al.

Deﬁnition 1 (right-angled triangles) A right-angled triangle is a triangle whose sides of length $a$, $b$ and $c$, in some permutation of order, satisﬁes ${a}^{2}+{b}^{2}={c}^{2}$.

Lemma 2 The triangle with sides of length $3$, $4$ and $5$ is right-angled.

This lemma follows from the Deﬁnition 1 as ${3}^{2}+{4}^{2}=9+16=25={5}^{2}$.

Theorem 3 (Pythagorean triplets) Triangles with sides of length $a={p}^{2}-{q}^{2}$, $b=2pq$ and $c={p}^{2}+{q}^{2}$ are right-angled triangles.

Prove this Theorem 3 by the algebra ${a}^{2}+{b}^{2}={\left({p}^{2}-{q}^{2}\right)}^{2}+{\left(2pq\right)}^{2}={p}^{4}-2{p}^{2}{q}^{2}+{q}^{4}+4{p}^{2}{q}^{2}={p}^{4}+2{p}^{2}{q}^{2}+{q}^{4}={\left({p}^{2}+{q}^{2}\right)}^{2}={c}^{2}$.