Inline math
Best for a symbol or short expression inside a sentence.
$x^2 + y^2 = z^2$$x^2 + y^2 = z^2$
This is the one rule to remember. Use one dollar sign on each side for math inside a sentence, or two on each side for a centered equation.
Best for a symbol or short expression inside a sentence.
$x^2 + y^2 = z^2$Best for an important equation on its own line.
$$\frac{a}{b} = c$$Copy an example and replace the letters or numbers with your own.
$\frac{a}{b}$$x^2 + a_{10}$$\sqrt{x+1} + \sqrt[3]{8}$$a \times b,\ x \le y,\ p \neq q$Use a backslash before a command name. Uppercase Greek letters usually start with a capital letter, such as \Delta.
$\alpha, \beta, \theta, \pi, \Delta$$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$$$\int_a^b f(x)\,dx$$$$f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$These examples combine commands. Keep the full expression inside double dollar signs.
$$\begin{aligned} 2x+3&=11 \\ 2x&=8 \\ x&=4 \end{aligned}$$$$A=\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$$$$f(x)=\begin{cases} x^2 & x\ge0 \\ -x & x<0 \end{cases}$$$$A\cap B=\{x\in A\mid x\in B\},\quad \forall x\in\mathbb{R}$$$$\vec{v}=\langle v_1,v_2\rangle,\quad \hat{x},\ \bar{x},\ \overline{AB}$$A quick reference for the symbols you are most likely to need.
| Use | Type | Result |
|---|---|---|
| Arrows | \to, \Rightarrow, \leftrightarrow | $\to, \Rightarrow, \leftrightarrow$ |
| Comparisons | \le, \ge, \neq, \approx | $\le, \ge, \neq, \approx$ |
| Operations | \cdot, \times, \div, \pm | $\cdot, \times, \div, \pm$ |
| Sets | \in, \notin, \subset, \cup, \cap | $\in, \notin, \subset, \cup, \cap$ |
| Spacing | a\,b \quad a\qquad b | $a\,b \quad a\qquad b$ |
| Text in math | x=2\text{ when }y=4 | $x=2\text{ when }y=4$ |
| Automatic brackets | \left(\frac{x}{y}\right) | $\left(\frac{x}{y}\right)$ |