Limit (lim) in LaTeX
\lim typesets the upright lim operator; a subscript written with \to states what the variable approaches, as in \lim_{x \to a}. For a limit at infinity write \lim_{x \to \infty}.
LaTeX command
\lim_{x \to a}Not the symbol you meant? Draw it to find the command →
Typing up handwritten notes? Convert a whole page of handwriting to LaTeX →
\lim is a named operator that sets lim upright with correct spacing. The point the variable tends to goes in a subscript, using \to (or \rightarrow) for the arrow: \lim_{x \to a} f(x). For a limit at infinity write \lim_{x \to \infty}, and for a one-sided limit add a sign to the target, or .
Placement of the subscript depends on mode. In displayed math the x to a sits centred beneath lim, which is the standard book form. Inline it appears as a subscript to the right to save vertical space. You can force the underneath position inline by wrapping the expression in \displaystyle.
Related operators follow the same pattern: \limsup and \liminf for the upper and lower limits, \sup and \inf, and \max and \min. All are predefined so they set upright with proper spacing. For a name of your own use \operatorname, or \operatorname* to put the limits underneath.
Other forms
\limsuplimit superior\liminflimit inferiorExamples
$\lim_{x \to 0} \frac{\sin x}{x} = 1$a standard limit
$\lim_{x \to \infty} \frac{1}{x} = 0$a limit at infinity
$\lim_{x \to 0^{+}} \ln x = -\infty$a one-sided limit
$\lim_{n \to \infty} \left(1 + \tfrac{1}{n}\right)^n = e$the definition of e
$\limsup_{n \to \infty} a_n$the limit superior
Tips and common mistakes
- Always use
\lim, not the plain letters lim, so the operator sets upright with correct spacing. - Put the target in a subscript with
\to:\lim_{x \to a}; use\inftyfor limits at infinity. - For one-sided limits mark the target: (from above) or (from below).
- In displayed math the subscript centres below lim; inline it moves to the side. Wrap in
\displaystyleto force the under-set form inline. \limsupand\liminfare their own commands; do not build them from\limplus text.
Working from handwritten notes?
LatexNotes turns a photo or PDF of handwritten mathematics into LaTeX, graphs and all. It is built with real pdflatex before you see it, and the .tex file is yours to edit or take to Overleaf. Free to try, no sign-up.
See how handwriting to LaTeX works, step by step, or go from GoodNotes to LaTeX if you write on an iPad (Notability works the same way).
Convert your maths to LaTeX →FAQ
How do I write a limit in LaTeX?
Use \lim with the target in a subscript, for example . \to draws the arrow.
How do I write a limit as x approaches infinity?
Put \infty in the subscript: .
Why is the x to a beside lim instead of underneath?
That is the inline form, which saves vertical space. In displayed math it centres beneath lim; you can force that inline by wrapping the expression in \displaystyle.