\[\]
A test collection for use on this website.
Accents and Diacritics:
$$\acute{a} \grave{a} \hat{a} \tilde{a} \breve{a}$$
$$\check{a} \bar{a} \ddot{a} \dot{a}$$
$$x’, y”$$
Superscript and subscript:
$$a_i$$
$$b_{ij}$$
$$C_{m,n}$$
$$\delta_{j+k}$$
$$x^y$$
$$a^{j2\pi}$$
$$x^2_3$$
$$C^k_{\mu,\nu}$$
$${}_1^2 \Psi_3^4$$
Underlines, overlines and stackings:
\[\hat a \ \bar b \ \vec c\]
\[\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}\]
$$\overbrace{ 1+2+\cdots+100 }^{5050}$$
$$\underbrace{ a+b+\cdots+z }_{26}$$
$$A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C$$
$$\overset{\alpha}{\omega} \underset{\mu}{\nu} \overset{\beta}{\underset{\Delta}{\tau}} \stackrel{\zeta}{\eta}$$
Trigonometric functions:
\begin{align*}
\cos^2 x +\sin^ 2 x=1
\end{align*}
Radicals:
\[
\sqrt{\matrix{a & b\cr c & d}}
\sqrt{
\rlap{\smash{\rm Hi!}}
\phantom{\matrix{a & b\cr c & d}}
}
\]
Arrows:
\begin{align*}
A\iff B\\
\implies\\
\impliedby\\
\iff\\
\mapsto\\
\to\\
\gets\\
\rightarrow\\
\leftarrow\\
\Rightarrow\\
\Leftarrow\\
\hookrightarrow\\
\hookleftarrow
\end{align*}
Cases:
\begin{align*}
\det(A)&=1+(-1)^{n+1} \\
&= \begin{cases}
2 & \text{ if } n \text{ is odd}\\
0 & \text{ if } n \text{ is even}.
\end{cases}
\end{align*}
\[
|x| =
\begin{cases}
x & \text{ if } x\ge 0 \\
-x & \text{ if } x \lt 0
\end{cases}
\]
Providing reasons for each line in align:
\begin{align*}
f(ab)&=(ab)^2 && (\text{by definition of $f$})\\
&=(ab)(ab)\\
&=a^2 b^2 && (\text{since $G$ is abelian})\\
&=f(a)f(b) && (\text{by definition of $f$}).
\end{align*}
\begin{gather}
a = a \tag{$*$}\\
\text{if } a=b \text{ then } b=a \tag{$\dagger$}\\
\text{if } a=b \text{ and } b=c \text{ then } a=c \tag{3.1}
\end{gather}
System of equations:
\begin{align*}
\left\{
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\
a_2x+b_2y+c_2z=d_2 \\
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
\end{align*}
Brackets:
\[
\left\langle
\matrix{a & b\cr c & d}
\right\rangle
\]
Braces:
\[
\left\lbrace
\matrix{a & b\cr c & d}
\right\rbrace
\]
Matrix:
\[
A = \pmatrix{
a_{11} & a_{12} & \ldots & a_{1n} \cr
a_{21} & a_{22} & \ldots & a_{2n} \cr
\vdots & \vdots & \ddots & \vdots \cr
a_{m1} & a_{m2} & \ldots & a_{mn} \cr
}
\]
Above is an $m \times n$ matrix, where $a_{ij}$ are elements of the matrix $A$, $i$ = the $i_{th}$ row and $j$ = the $j_{th}$ column.
$\\\\$
The sequence of numbers:
$$A_{(i)} = (a_{i1}, \dotsc, a_{in})$$
is the $i_{th}$ row of A, and the sequence of numbers:
$$A_{(j)} = (a_{1j}, \dotsc, a_{mj})$$
is the $j_{th}$ column of A.
Displaying a matrix:
$$\begin{bmatrix} 17 & 18 & 5 & 5 & 45 & 1 \\ 42 & 28 & 30 & 15 & 115 & 3 \\ 10 & 10 & 10 & 21 & 51 & 2 \\ 28 & 5 & 65 & 39 & 132 & 5 \\ 24 & 26 & 45 & 21 & 116 & 4 \end{bmatrix}$$
Augmented matrix:
\begin{align*}
\left[\begin{array}{rrr|rrr}
1 & 0 & 0 & 1 &1 & 1 \\
0 & 1 & 0 & 0 & 1 & 1 \\
0 & 0 & 1 & 0 & 0 & 1 \\
\end{array} \right]
\end{align*}
Block matrix:
\begin{align*}
M=
\left[\begin{array}{c|c}
A & B\\
\hline
C & D
\end{array}
\right]
\end{align*}
Matrix with fractions:
\begin{align*}
A=\begin{bmatrix}
\frac{1}{3} & \frac{1}{3} & \frac{1}{3} \\
\frac{2}{3} &\frac{-1}{3} &\frac{-1}{3} \\
\frac{1}{3} & \frac{1}{3} & \frac{-2}{3}
\end{bmatrix}
\end{align*}
Elementary row operations (Gauss-Jordan elimination):
\begin{align*}
\left[\begin{array}{rrrr|r}
1 & 1 & 1 & 1 &1 \\
0 & 1 & 2 & 3 & 5 \\
0 & -2 & 0 & -2 & 2 \\
0 & 1 & -2 & 3 & 1 \\
\end{array}\right]
\xrightarrow{\substack{R_1-R_2 \\ R_3-R_2\\R_4-R_2}}
\left[\begin{array}{rrrr|r}
1 & 0& -1 & -2 &-4 \\
0 & 1 & 2 & 3 & 5 \\
0 & 0 & 4 & 4 & 12 \\
0 & 0 & -4 & 0 & -4 \\
\end{array}\right]
\xrightarrow[\frac{-1}{4}R_4]{\frac{1}{4}R_3}
\left[\begin{array}{rrrr|r}
1 & 0& -1 & -2 &-4 \\
0 & 1 & 2 & 3 & 5 \\
0 & 0 & 1 & 1 & 3 \\
0 & 0 & 1 & 0& 1 \\
\end{array}\right]
\end{align*}
Use array for tabular:
\begin{array}{ |c|c|c| }
\hline
a & a^2 \pmod{5} & 2a^2 \pmod{5} \\
\hline
0 & 0 & 0 \\
1& 1 & 2 \\
2& 4 & 3 \\
3 & 4 & 3\\
4 & 1 & 2\\
\hline
\end{array}
Sums:
$$\sum_{k=1}^n a_k$$
\[
\sum_{
\substack{
1\lt i\lt 3 \\
1\le j\lt 5
}}
a_{ij}
\]
Sub-arrays:
\[
\prod_{\begin{subarray}{rl}
i\lt 5\quad & j\gt 1 \\
k\ge2,\,k\ne 5 \quad & \ell\le 5,\,\ell\ne 2
\end{subarray}}
x_{ijk\ell}
\]
Integration:
$$\int\limits_a^b f(x)\,dx$$
\begin{align*}
\int_{a}^{b} \! f(x)\,\mathrm{d}x
\end{align*}
\[
\frac{1}{2\pi}\int_{-\infty}^{\infty}e^{-\frac{x^2}{2}}dx
\]
Second derivative:
\begin{align*}
f^{\prime\prime}
\end{align*}
Explanations under equations:
\begin{align*}
n=\underbrace{1+1+\cdots+1}_{\text{$n$ times}}
\end{align*}
Explanations over equations:
\[
\overbrace{x+\cdots+x}^{n\text{ times}}
\]
\[
\overparen a \quad
\overparen ab \quad
\overparen{ab} \quad
\overparen{abc} \quad
\overparen{abcdef} \quad
\overparen{\underparen{abcd}}
\]
Inline:
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
Displayed:
$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
\[
% Note: (x+1)^2 is NOT x^2 + 1
(x+1)^2 % original expression
= (x+1)(x+1) % definition of exponent
= x^2 + 2x + 1 % FOIL, combine like terms
\\
\{x\,|\,x\in\Bbb Z\}
\]
Parentheses:
$$\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)$$
Fractions:
$$\frac{100}{20} = 5$$
$${a+1\over b+1}$$
$$\displaystyle\frac ab + {\textstyle \frac cd + \frac ef} + \frac gh$$
$$\left\{\frac ab,c\right\}$$
$$|\frac ab|$$
$$\left(\frac{a+b}{\dfrac{c}{d}}\right)$$
$$\left(\vcenter{\frac{a+b}{\dfrac{c}{d}}}\right)$$
\[
\displaystyle
\frac{2x+3y-\phantom{5}z}
{\phantom{2}x+\phantom{3}y+5z}
\]
$${a+1 \overwithdelims \{ \} b+2}+c$$
$$\left(\frac ab,c\right)$$
$${a+1 \above 1.5pt b+2}+c$$
$$\cfrac{2}{1+\cfrac{2}{1+\cfrac{2}{1}}}$$
\[
\def\specialFrac#1#2{\frac{x + #1}{y + #2}}
\specialFrac{7}{z+3}
\]
$$\sqrt[3]{\frac xy}$$
Partial differentials:
\[
i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>
\]
Graphics:

From the image we can see…
Definitions, Remarks, lemmas, etc.:
- For every open set $V$ in $Y$, the inverse image $f^{-1}(V)$ is measurable.
Referencing equations:
\[
\]
At first, we sample $f(x)$ in the $N$ ($N$ is odd) equidistant points around $x^*$:
\[
f_k = f(x_k),\: x_k = x^*+kh,\: k=-\frac{N-1}{2},\dots,\frac{N-1}{2}
\]
where $h$ is some step.
Then we interpolate points $\{(x_k,f_k)\}$ by polynomial
\[\begin{equation} \label{eq:poly}
P_{N-1}(x)=\sum_{j=0}^{N-1}{a_jx^j}
\end{equation}\]
Its coefficients $\{a_j\}$ are found as a solution of system of linear equations:
\[\begin{equation} \label{eq:sys}
\left\{ P_{N-1}(x_k) = f_k\right\},\quad k=-\frac{N-1}{2},\dots,\frac{N-1}{2}
\end{equation}\]
Here are references to existing equations: (\[eq:poly\]), (\[eq:sys\]).
Here is reference to non-existing equation (\[eq:unknown\]).
Math scripting:
$$\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$
$$\Bbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$
$$\cal ABCDEFGHIJKLMNOPQRSTUVWXYZ$$
$$\frak ABCDEFGHIJKLMNOPQRSTUVWXYZ$$
$$\huge AaBb\alpha\beta123\frac ab\sqrt x$$
In-line Mathematics:
While display equations look good for a page of samples, the ability to mix math and text in a paragraph is also important. This expression \(\sqrt{3x-1}+(1+x)^2\) is an example of an inline equation. As you see, equations can be used this way as well, without unduly disturbing the spacing between lines.
A Cross Product Formula:
\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\ \end{vmatrix}\]
The probability of getting \(k\) heads when flipping \(n\) coins is:
\[P(E) = {n \choose k} p^k (1-p)^{ n-k}\]
$$\pmb{\mathrm{An \ Identity \ of \ Ramanujan:}}$$
\[\frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } }\]
$$\pmb{\mathrm{A \ Rogers-Ramanujan \ Identity:}}$$
\[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for $|q|<1$}.\]
$$\pmb{\mathrm{Maxwell's \ Equations:}}$$
\[\begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{align}\]
$$\pmb{\mathrm{The \ Lorenz \ Equations:}}$$
\[\begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align}\]
$$\pmb{\mathrm{The \ Cauchy-Schwarz \ Inequality:}}$$
\[\left( \sum_{k=1}^n a_k b_k \right)^{\!\!2} \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]
LaTeX