LaTeX practice: type the maths you see
Each question shows a formula. Type its LaTeX in the box below it, and it is marked as you type. Stuck? Open the hint, or show the answer.
Free, no account. Your answers stay on this page: nothing is saved or sent.
New to LaTeX? Learn it step by step in LaTeX for Maths, a free course of twelve short lessons.
Powers and subscripts
0 / 6Type ^ for a power and _ for a subscript. Only the next character is raised or lowered, so put anything longer in braces: x^{10}, not x^10.
A power uses
^.x^2A subscript uses
_.a_1Two characters need braces:
x^{10}.x^{10}Use both, in either order:
_for the 1 and^for the 2.x_1^2A power can hold another power: put
-x^2in braces aftere^.e^{-x^2}The whole subscript
n+1goes in braces:a_{n+1}.a_{n+1} = 2a_n + 1
Fractions and roots
0 / 6\frac{top}{bottom} makes a fraction and \sqrt{x} a square root. For any other root, put its number in square brackets: \sqrt[3]{x}.
Read the guide: Fractions in LaTeX
\fractakes the top, then the bottom, each in braces.\frac{1}{2}Everything on top goes in the first pair of braces.
\frac{a+b}{c}\sqrt{...}puts what is in the braces under a root.\sqrt{2}The 3 goes in square brackets, before the braces:
\sqrt[3]{x}.\sqrt[3]{x}Put a second
\fracinside the bottom of the first.\frac{1}{1 + \frac{1}{x}}\pmgives ±, and the square root sits in the top of the fraction.x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
Greek letters
0 / 6A Greek letter is its name after a backslash: \alpha, \theta, \pi. Start the name with a capital for the capital letter: \Delta, \Omega.
Read the guide: Greek letters in LaTeX
Type the letter's name after a backslash.
\alphaThis one is theta.
\thetaA capital first letter gives the capital:
\Delta.\Delta xLambda twice, each with a subscript.
\lambda_1, \lambda_2Sigma, then a power.
\sigma^2\Omegais a capital omega and\piis pi.\Omega = 2\pi f
Operators and relations
0 / 6Symbols that are not on the keyboard each have a command: \times for ×, \cdot for a centred dot, \leq for ≤, \neq for ≠ and \approx for ≈.
Read the guide: LaTeX symbols
\timesgives the multiplication sign.3 \times 4 = 12\cdotgives a dot in the middle of the line.a \cdot b\leq(or\le) gives ≤.x \leq 5\neqgives ≠.x \neq 0\approxgives ≈.\pi \approx 3.14\togives the arrow and\inftygives ∞.x \to \infty
Brackets that grow
0 / 6Brackets typed on their own stay small. Write \left before the opening bracket and \right before the closing one, and they grow to fit what is between them. Curly braces need a backslash: \{ and \}.
Read the guide: Brackets and delimiters in LaTeX
\left(before the fraction and\right)after it.\left( \frac{1}{2} \right)Square brackets grow the same way:
\left[and\right].\left[ \frac{a}{b} \right]Bars for an absolute value:
\left|and\right|.\left| \frac{x}{2} \right|Curly braces need a backslash:
\{and\}.\{1, 2, 3\}The brackets grow around the sum, and the
^2goes after\right).\left( \sum_{i=1}^{n} x_i \right)^2\|gives the double bars of a length, and\mathbf{v}makes v bold.\|\mathbf{v}\|
Sums and products
0 / 6\sum and \prod take their limits from _ and ^. In a formula on its own line, like these, the limits sit below and above the symbol.
Read the guide: Summation (∑)
\sum_{bottom}^{top}, then what is being added.\sum_{i=1}^{n} iThe top limit is
\infty.\sum_{k=0}^{\infty} \frac{1}{2^k}\prodworks just like\sum.\prod_{i=1}^{n} a_iA sum, an equals sign, then a fraction.
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\binom{n}{k}gives the binomial coefficient.\sum_{k=0}^{n} \binom{n}{k} = 2^nTwo sums in a row, and the subscript
ijneeds braces.\sum_{i=1}^{m} \sum_{j=1}^{n} a_{ij}
Integrals
0 / 6\int gives the integral sign, with its limits in _ and ^. A thin space, \,, before the dx is the usual style; here it is optional.
Read the guide: Integrals in LaTeX
\int, the function, then\, dx.\int x \, dxThe limits go straight after
\int:\int_0^1.\int_0^1 x^2 \, dxThe bottom limit
-\inftyneeds braces.\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}\iintgives a double integral sign.\iint_D f(x, y) \, dA\ointis the integral sign with a circle.\oint_C \mathbf{F} \cdot d\mathbf{r}The fraction
\frac{d}{dx}goes in front of the integral.\frac{d}{dx} \int_a^x f(t) \, dt = f(x)
Limits, derivatives and functions
0 / 6Names like \sin, \log and \lim are commands, so they print upright instead of as slanted letters. \lim takes what x tends to from _, and ' gives a prime.
Read the guide: Derivatives in LaTeX
Use
\sin: without the backslash the letters come out slanted.\sin x\logtakes its base as a subscript.\log_2 8 = 3\lim_{x \to 0}, then the fraction.\lim_{x \to 0} \frac{\sin x}{x} = 1An apostrophe gives the prime.
f'(x)A fraction with dy on top and dx below.
\frac{dy}{dx}\partialgives ∂.\frac{\partial f}{\partial x}
Vectors and sets
0 / 6\mathbf{v} makes a bold vector and \vec{v} puts an arrow over it. \mathbb{R} gives the blackboard-bold R of the real numbers, and \in, \cup and \subseteq are set symbols.
Read the guide: Vectors in LaTeX
\mathbf{...}makes it bold.\mathbf{v}\vec{...}puts an arrow over a letter.\vec{a} \cdot \vec{b}\ingives ∈ and\mathbb{R}the blackboard-bold R.x \in \mathbb{R}\cupgives the union sign.A \cup B\subseteqgives ⊆.A \subseteq B\mathbb{Z}gives the integers, and the braces need a backslash.\{ x \in \mathbb{Z} : x > 0 \}
Matrices and cases
0 / 6A matrix goes between \begin{pmatrix} and \end{pmatrix}: & moves to the next column and \\ starts a new row. bmatrix gives square brackets, vmatrix straight bars, and cases the brace of a function in several parts.
Read the guide: Matrices in LaTeX
Two rows:
1 & 0, then\\, then0 & 1.\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}bmatrixgives square brackets.\begin{bmatrix} a & b \\ c & d \end{bmatrix}vmatrixgives the straight bars of a determinant.\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bcOne column: no
&, just\\between the rows.\begin{pmatrix} x \\ y \\ z \end{pmatrix}Each entry has a two-digit subscript in braces.
A = \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix}Inside
cases,&comes before each condition and\text{if }writes the word.|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}
Would you rather write it by hand?
LatexNotes turns a photo or PDF of your handwritten maths into LaTeX like this. Free to try, no sign-up.
Convert your handwriting to LaTeX →