LaTeX Math Formulas: A Practical Guide

Write beautiful mathematical equations in your documents with LaTeX syntax.

Introduction to LaTeX Math

LaTeX is the standard for writing mathematical notation in academic and scientific documents. ConvertMD2PDF uses KaTeX to render LaTeX formulas directly in your browser, supporting both inline and display math.

Inline math appears within text using single dollar signs:

The formula $E = mc^2$ changed physics forever.

Display math appears on its own line, centered, using double dollar signs:

$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Basic Operations

Arithmetic

$a + b - c$
$a \times b$
$a \div b$
$a \pm b$       (plus-minus)
$a \mp b$       (minus-plus)

Fractions

$\frac{a}{b}$           (basic fraction)
$\frac{1}{2}$           (one-half)
$\dfrac{a}{b}$          (larger fraction)
$\tfrac{a}{b}$          (smaller fraction)
$\frac{a + b}{c + d}$   (complex numerator/denominator)

Powers and Subscripts

$x^2$                   (squared)
$x^{10}$                (multi-digit exponent)
$x_i$                   (subscript)
$x_{i,j}$               (multi-character subscript)
$x_i^2$                 (both)
$a_{n+1} = a_n + d$     (arithmetic sequence)

Greek Letters

Greek letters are essential in mathematical notation:

$\alpha, \beta, \gamma, \delta, \epsilon$
$\theta, \lambda, \mu, \pi, \sigma$
$\omega, \Omega, \Sigma, \Delta$

Lowercase: $\alpha$ $\beta$ $\gamma$ $\delta$ $\epsilon$ $\theta$ $\lambda$ $\mu$ $\pi$ $\sigma$ $\omega$
Uppercase: $\Gamma$ $\Delta$ $\Theta$ $\Lambda$ $\Pi$ $\Sigma$ $\Omega$

Square Roots and Radicals

$\sqrt{x}$              (square root)
$\sqrt[3]{x}$           (cube root)
$\sqrt[n]{x}$           (nth root)
$\sqrt{a^2 + b^2}$      (Pythagorean)

Summations and Products

$\sum_{i=1}^{n} x_i$                    (summation)
$\sum_{i=0}^{\infty} \frac{1}{2^i}$     (infinite series)
$\prod_{i=1}^{n} x_i$                   (product)
$\lim_{x \to \infty} f(x)$              (limit)

Integrals

$\int f(x) dx$                          (indefinite integral)
$\int_{a}^{b} f(x) dx$                  (definite integral)
$\iint f(x,y) dx dy$                    (double integral)
$\oint_C f(x) dx$                       (line integral)

Example: Gaussian Integral

$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$

Matrices

$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$     (parentheses)
$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$     (brackets)
$\begin{vmatrix} a & b \\ c & d \end{vmatrix}$     (determinant)

Larger Matrix Example

$$
A = \begin{pmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pmatrix}
$$

Common Mathematical Symbols

Relations:
$\lt \gt \le \ge \neq \approx \equiv$

Sets:
$\in \notin \subset \supset \cup \cap \emptyset$

Logic:
$\forall \exists \neg \land \lor \implies \iff$

Arrows:
$\to \rightarrow \leftarrow \Rightarrow \Leftarrow \leftrightarrow$

Misc:
$\infty \partial \nabla \Re \Im$

Practical Examples

Quadratic Formula

$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

Euler's Identity

$$
e^{i\pi} + 1 = 0
$$

Bayes' Theorem

$$
P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}
$$

Normal Distribution

$$
f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$

Maxwell's Equations (simplified)

$$
\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}
$$

Text in Math Mode

When you need text inside a formula:

$x = 1 \text{ if } y > 0$
$\text{when } x \to \infty$

Alignment with align

For multi-line equations:

$$
\begin{align}
f(x) &= (x+1)^2 \\
     &= x^2 + 2x + 1
\end{align}
$$

Try It Yourself

Ready to write your own equations? Open ConvertMD2PDF and start experimenting with LaTeX math. The preview updates in real-time, so you can see your formulas render instantly.