LaTeX commands for math input
The math input on practice questions accepts LaTeX. You can type most expressions directly using the keys on your keyboard, but the commands below let you write Greek letters, fractions, integrals, and anything else that doesn't have its own key.
Tips for typing math
- Type $ (or click the f(x) button) to start a math island, where everything formats as you type. Press $ again to step back out into normal text.
- You can select any string of plain text and press $ to turn just that selection into math.
- Use the symbol buttons below the input to insert common notation (fractions, roots, π, ∫, and more) without remembering the command. Inside an island the spacebar adds a space, and the arrow keys move in and out of it.
- Many commands have keyboard shortcuts. Try typing pi, sqrt, or / (for a fraction) and the input will convert them automatically.
- To type a command by name, press \ first, then the command, then Enter (or Tab) to commit.
- Use { } to group anything longer than one character. For example
x^{n+1}keeps the whole exponent up top. - Tab moves between the slots of a fraction, root, or matrix. Shift + Tab moves backwards.
Fractions & roots
\frac{a}{b}$$\frac{a}{b}$$
Fraction\dfrac{a}{b}$$\dfrac{a}{b}$$
Display-size fraction (always large)\tfrac{a}{b}$$\tfrac{a}{b}$$
Inline-size fraction (always small)\sqrt{x}$$\sqrt{x}$$
Square root\sqrt[n]{x}$$\sqrt[n]{x}$$
n-th root\binom{n}{k}$$\binom{n}{k}$$
Binomial coefficient (n choose k)Powers, subscripts & accents
Use { } to group anything longer than a single character.
x^2$$x^2$$
Powerx^{n+1}$$x^{n+1}$$
Multi-character exponentx_i$$x_i$$
Subscriptx_{i+1}$$x_{i+1}$$
Multi-character subscriptx_i^2$$x_i^2$$
Sub and superscript\vec{v}$$\vec{v}$$
Vector arrow\hat{x}$$\hat{x}$$
Hat\bar{x}$$\bar{x}$$
Bar (often for mean)\overline{abc}$$\overline{abc}$$
Overline across a group\dot{x}$$\dot{x}$$
Single dot (time derivative)\ddot{x}$$\ddot{x}$$
Double dotGreek letters
Lowercase is the command name in lower case; capitals start with an uppercase letter.
\alpha$$\alpha$$
\beta$$\beta$$
\gamma$$\gamma$$
\delta$$\delta$$
\epsilon$$\epsilon$$
\varepsilon$$\varepsilon$$
Variant epsilon\theta$$\theta$$
\lambda$$\lambda$$
\mu$$\mu$$
\pi$$\pi$$
\rho$$\rho$$
\sigma$$\sigma$$
\phi$$\phi$$
\varphi$$\varphi$$
Variant phi\omega$$\omega$$
\Delta$$\Delta$$
\Sigma$$\Sigma$$
\Pi$$\Pi$$
\Omega$$\Omega$$
\Theta$$\Theta$$
Operators
a \times b$$a \times b$$
Multiplication (cross)a \cdot b$$a \cdot b$$
Multiplication (dot)a \div b$$a \div b$$
Division\pm$$\pm$$
Plus or minus\mp$$\mp$$
Minus or plusRelations
=$$=$$
\neq$$\neq$$
Not equal<$$<$$
>$$>$$
\leq$$\leq$$
Less than or equal\geq$$\geq$$
Greater than or equal\approx$$\approx$$
Approximately equal\equiv$$\equiv$$
Identically equal\sim$$\sim$$
Similar / distributed as\propto$$\propto$$
Proportional toTrigonometry, log & exp
Use the named command rather than typing the letters. It sets the right font and spacing.
\sin x$$\sin x$$
\cos x$$\cos x$$
\tan x$$\tan x$$
\sec x$$\sec x$$
\csc x$$\csc x$$
\cot x$$\cot x$$
\arcsin x$$\arcsin x$$
\arccos x$$\arccos x$$
\arctan x$$\arctan x$$
\log x$$\log x$$
Log; add a base, as below, so it's unambiguous\log_{2} x$$\log_{2} x$$
Log of another base\ln x$$\ln x$$
Natural log\exp(x)$$\exp(x)$$
Sums, products, integrals & limits
Use _ for the lower bound and ^ for the upper bound.
\sum_{i=1}^{n} a_i$$\sum_{i=1}^{n} a_i$$
Summation\prod_{i=1}^{n} a_i$$\prod_{i=1}^{n} a_i$$
Product\int_{a}^{b} f(x)\,dx$$\int_{a}^{b} f(x)\,dx$$
Definite integral\int f(x)\,dx$$\int f(x)\,dx$$
Indefinite integral\oint$$\oint$$
Closed-path integral\lim_{x \to 0} f(x)$$\lim_{x \to 0} f(x)$$
Limit\lim_{x \to \infty} f(x)$$\lim_{x \to \infty} f(x)$$
Limit at infinityCalculus
\frac{dy}{dx}$$\frac{dy}{dx}$$
Derivative\frac{d^2 y}{dx^2}$$\frac{d^2 y}{dx^2}$$
Second derivative\frac{\partial f}{\partial x}$$\frac{\partial f}{\partial x}$$
Partial derivative\nabla f$$\nabla f$$
Gradient\infty$$\infty$$
InfinitySets, logic & symbols
\in$$\in$$
Element of\notin$$\notin$$
Not an element of\subset$$\subset$$
Subset\subseteq$$\subseteq$$
Subset or equal\cup$$\cup$$
Union\cap$$\cap$$
Intersection\emptyset$$\emptyset$$
Empty set\mathbb{R}$$\mathbb{R}$$
Real numbers\mathbb{Z}$$\mathbb{Z}$$
Integers\mathbb{N}$$\mathbb{N}$$
Natural numbers\mathbb{Q}$$\mathbb{Q}$$
Rationals\mathbb{C}$$\mathbb{C}$$
Complex numbers\forall$$\forall$$
For all\exists$$\exists$$
There exists\therefore$$\therefore$$
\because$$\because$$
Arrows
\to$$\to$$
Right arrow (same as \rightarrow)\leftarrow$$\leftarrow$$
\Rightarrow$$\Rightarrow$$
Implies\Leftarrow$$\Leftarrow$$
\Leftrightarrow$$\Leftrightarrow$$
If and only if\mapsto$$\mapsto$$
Maps toBrackets & delimiters
Wrap with \left and \right to make brackets grow with their contents.
\left( \frac{a}{b} \right)$$\left( \frac{a}{b} \right)$$
Auto-sized parentheses\left[ \frac{a}{b} \right]$$\left[ \frac{a}{b} \right]$$
Auto-sized square brackets\left\{ \frac{a}{b} \right\}$$\left\{ \frac{a}{b} \right\}$$
Auto-sized curly braces\left| x \right|$$\left| x \right|$$
Absolute value\langle v, w \rangle$$\langle v, w \rangle$$
Angle brackets (inner product)\lfloor x \rfloor$$\lfloor x \rfloor$$
Floor\lceil x \rceil$$\lceil x \rceil$$
CeilingMatrices
Rows are separated by \\, columns by &.
\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
Matrix with parentheses\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$
Matrix with square brackets\begin{vmatrix} a & b \\ c & d \end{vmatrix}$$\begin{vmatrix} a & b \\ c & d \end{vmatrix}$$
DeterminantPiecewise & multiline
f(x) = \begin{cases} x & x \geq 0 \\ -x & x < 0 \end{cases}$$f(x) = \begin{cases} x & x \geq 0 \\ -x & x < 0 \end{cases}$$
Piecewise functionMiscellaneous
\ldots$$\ldots$$
Low dots\cdots$$\cdots$$
Centered dots\vdots$$\vdots$$
Vertical dots\ddots$$\ddots$$
Diagonal dots90^{\circ}$$90^{\circ}$$
Degrees\angle ABC$$\angle ABC$$
Angle\text{hello}$$\text{hello}$$
Plain text inside math