Contents

Writing Mathematical Notation in LaTeX

As is well known, TeX\TeX was designed to produce beautiful books, especially books containing a lot of mathematics. Because of that, LaTeX\LaTeX is very strong for preparing documents with mathematical notation. To write mathematical symbols and formulas, we need to use the mathematical environment.

Mathematical formulas in TeX\TeX can be written between $...$ or $$...$$.

The difference is:

  1. Formulas between $...$ or \(...\) appear as part of a sentence. This is called an inline equation.
  2. Formulas between $$...$$ or \[...\] appear as stand-alone formulas. This is called a displayed equation.

If you want numbered equations, use the equation environment.

Example:

Inline formula: $a^2+b^2=c^2$

\[
\int_0^1 x^2 \, dx
\]

\begin{equation}
E = mc^2
\end{equation}

The output can be seen in the following image.

Inline and displayed formulas in LaTeX

A subscript is written below a symbol and usually uses _.
A superscript is written above a symbol and usually uses ^.

Example:

$x_1,\ a_n,\ y^2,\ x^{n+1}$

The output:

Subscript and superscript in LaTeX

To write binomial notation, use \binom{...}{...}.

Example:

\[
\binom{n}{r}
\]

The output:

Binomial notation in LaTeX

To write:

  • integrals, use \int
  • roots, use \sqrt{...}
  • fractions, use \frac{...}{...}

Example:

\[
\int x^2 \, dx,\qquad
\sqrt{x+1},\qquad
\frac{a+b}{c+d}
\]

The output:

Integral, root, and fraction notation in LaTeX

To write matrices, we can use parentheses or square brackets.

Example:

\[
\begin{pmatrix}
1 & 2 \\
3 & 4
\end{pmatrix}
\qquad
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\]

The output:

Matrix in LaTeX

To write limits, use \lim.

Example:

\[
\lim_{x \to 0}\frac{\sin x}{x}
\]

The output:

Limit in LaTeX

To write sigma notation, use \sum.

Example:

\[
\sum_{i=1}^{n} i^2
\]

The output:

Sigma in LaTeX

Systems of equations are commonly written with curly brackets. For this, we can use the amsmath or systeme package.

Example:

\[
\begin{cases}
x+y=5 \\
2x-y=1
\end{cases}
\]

The output:

System of equations in LaTeX

In mathematical formulas, brackets are often used to separate expressions.

Example:

\[
\left( \frac{a+b}{c+d} \right),
\quad
\left[ x^2+y^2 \right],
\quad
\left\{ \frac{x}{y} \right\}
\]

The output:

Brackets in LaTeX

Besides the examples above, there are many more techniques for writing mathematics in LaTeX\LaTeX. If you want to study the symbols in more detail, the documentation can be downloaded here.

That is a short guide to writing mathematical notation in LaTeX. If you have suggestions or corrections, please leave them in the comments.

Related Content