LaTeX#


LaTeX is a programming environment for producing scientific documents. Jupyter notebook recognizes LaTeX code written in markdown cells and renders the mathematical symbols in the browser using the MathJax JavaScript library.

Mathematics Inline and Display#


Enclose LaTeX code in dollar signs $ ... $ to display math inline. For example, the code $\int_a^b f(x) = F(b) - F(a)$ renders inline as \( \int_a^b f(x) dx = F(b) - F(a) \).

Enclose LaTeX code in double dollar signs $$ ... $$ to display expressions in a centered paragraph. For example:

$$f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x-a}$$

renders as

\[f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x-a}\]

See the LaTeX WikiBook for more information (especially the section on mathematics).

Common Symbols#

Below we give a list of commonly used mathematical symbols. Most other symbols can be inferred from these examples. See the LaTeX WikiBook (Mathematics) and the Detexify App to find any symbol you can think of!

Syntax

Output

$x_n$

\(x_n\)

$x^2$

\(x^2\)

$\infty$

\(\infty\)

$\frac{a}{b}$

\(\frac{a}{b}\)

$\partial$

\(\partial\)

$\alpha$

\(\alpha\)

$\beta$

\(\beta\)

$\gamma$

\(\gamma\)

$\Gamma$

\(\Gamma\)

$\Delta$

\(\Delta\)

$\sin$

\(\sin\)

$\cos$

\(\cos\)

$\tan$

\(\tan\)

$\sum_{n=0}^{\infty}$

\(\sum_{n=0}^{\infty}\)

$\prod_{n=0}^{\infty}$

\(\prod_{n=0}^{\infty}\)

$\int_a^b$

\(\int_a^b\)

$\lim_{x \to a}$

\(\lim_{x \to a}\)

$\mathrm{Hom}$

\(\mathrm{Hom}\)

$\mathbf{v}$

\(\mathbf{v}\)

$\mathbb{Z}$

\(\mathbb{Z}\)

$\mathscr{L}$

\(\mathscr{L}\)

$\mathfrak{g}$

\(\mathfrak{g}\)

$\dots$

\(\dots\)

$\vdots$

\(\vdots\)

$\ddots$

\(\ddots\)

Matrices and Brackets#


Create a matrix without brackets:

$$\begin{matrix} a & b \\ c & d \end{matrix}$$
\[\begin{split} \begin{matrix} a & b \\\ c & d \end{matrix} \end{split}\]

Create a matrix with round brackets:

$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
\[\begin{split} \begin{pmatrix} a & b \\\ c & d \end{pmatrix} \end{split}\]

Create a matrix with square brackets:

$$\begin{bmatrix} 1 & 2 & 1 \\ 3 & 0 & 1 \\ 0 & 2 & 4 \end{bmatrix}$$
\[\begin{split} \begin{bmatrix} 1 & 2 & 1 \\\ 3 & 0 & 1 \\\ 0 & 2 & 4 \end{bmatrix} \end{split}\]

Use \left and \right to enclose any expression in brackets:

$$\left( \frac{p}{q} \right)$$
\[\left( \frac{p}{q} \right)\]

Examples#


Derivative#

The derivative \(f'(a)\) of the function \(f(x)\) at the point \(x=a\) is the limit:

$$f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}$$
\[f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}\]

Continuity#

A function \(f(x)\) is continuous at a point \(x=a\) if:

$$\lim_{x \to a^-} f(x) = f(a) = \lim_{x \to a^+} f(x)$$
\[\lim_{x \to a^-} f(x) = f(a) = \lim_{x \to a^+} f(x)\]

MacLaurin Series#

The MacLaurin series for \(e^x\) is:

$$e^x = \sum_{k=0}^{\infty} \frac{x^k}{k!}$$
\[e^x = \sum_{k=0}^{\infty} \frac{x^k}{k!}\]

Jacobian Matrix#

The Jacobian matrix of the function \(\mathbf{f}(x_1, \dots, x_n)\) is:

$$
\mathbf{J}
=
\frac{d \mathbf{f}}{d \mathbf{x}}
=
\left[ \frac{\partial \mathbf{f}}{\partial x_1}
\cdots \frac{\partial \mathbf{f}}{\partial x_n} \right]
=
\begin{bmatrix}
\frac{\partial f_1}{\partial x_1} & \cdots &
\frac{\partial f_1}{\partial x_n} \\
\vdots & \ddots & \vdots \\
\frac{\partial f_m}{\partial x_1} & \cdots &
\frac{\partial f_m}{\partial x_n}
\end{bmatrix}
$$
\[\begin{split} \mathbf{J} = \frac{d \mathbf{f}}{d \mathbf{x}} = \left[ \frac{\partial \mathbf{f}}{\partial x_1} \cdots \frac{\partial \mathbf{f}}{\partial x_n} \right] = \begin{bmatrix} \frac{\partial f_1}{\partial x_1} & \cdots & \frac{\partial f_1}{\partial x_n} \\\ \vdots & \ddots & \vdots \\\ \frac{\partial f_m}{\partial x_1} & \cdots & \frac{\partial f_m}{\partial x_n} \end{bmatrix} \end{split}\]