Limit in LaTeX
Write \lim followed by the condition as a subscript: \lim_{x \to a} f(x). \to draws the arrow. In a displayed equation the condition sits under “lim”; inside a line of text it moves to the side unless you add \limits.
Limit commands
\lim_{x \to a} f(x)Limit as x approaches a.
\lim_{x \to \infty} f(x)Limit at infinity.
\lim_{x \to a^{+}} f(x)Right-hand limit.
\lim_{x \to a^{-}} f(x)Left-hand limit.
\lim_{n \to \infty} a_nLimit of a sequence.
\limsup_{n \to \infty} a_nLimit superior (amsmath).
\liminf_{n \to \infty} a_nLimit inferior (amsmath).
\lim\limits_{x \to 0}Keeps the condition under lim inside running text.
x \searrow 0Decreasing approach, used by some authors instead of 0⁺.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
Limit examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Classic limit
LaTeX\lim_{x \to 0} \frac{\sin x}{x} = 1Definition of e
LaTeX\lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^{n} = eOne-sided limits
LaTeX\lim_{x \to 0^{+}} \frac{1}{x} = \infty, \quad \lim_{x \to 0^{-}} \frac{1}{x} = -\inftyDerivative as a limit
LaTeXf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}Limit superior
LaTeX\limsup_{n \to \infty} \sin n = 1Two-variable limit
LaTeX\lim_{(x, y) \to (0, 0)} \frac{x y}{\sqrt{x^2 + y^2}} = 0Limit in running text
LaTeX\textstyle \lim\limits_{x \to \infty} \frac{1}{x} = 0With
\limitsthe condition stays under “lim” even at text size.
How to write a limit step by step
Use \lim, not the letters lim. The command sets “lim” upright, spaces it as an operator and knows where the subscript belongs; typed letters come out as italic variables l·i·m.
Put the whole condition in braces after _: \lim_{x \to 0}. \to and \rightarrow draw the same arrow; \to is shorter and the usual choice. For one-sided limits add ^{+} or ^{-} to the value: x \to 0^{+}.
Displayed equations put the condition under “lim”. Inline, LaTeX moves it to the right to keep the line height; \lim\limits_{…} overrides that for one limit.
\[
\lim_{x \to 0} \frac{\sin x}{x} = 1
\]
In text: $\lim\limits_{n \to \infty} \frac{1}{n} = 0$.Your own limit-like operators
For names amsmath does not define, such as ess sup or arg max, declare an operator with limits: \DeclareMathOperator*{\esssup}{ess\,sup} in the preamble, or \operatorname*{arg\,max}_{x} in place. The star is what puts the subscript underneath in displays.
Common mistakes
Without the backslash “lim” is three italic variables and the subscript attaches only to the m.
Instead oflim_{x \to 0} f(x)Write\lim_{x \to 0} f(x)Only
xis in the subscript; the arrow and 0 end up on the main line.Instead of\lim_x \to 0 f(x)Write\lim_{x \to 0} f(x)->is set as a minus sign and a greater-than sign, not an arrow.Instead of\lim_{x -> 0}Write\lim_{x \to 0}
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\limworks in any document.\limsup,\liminf,\operatorname*and\DeclareMathOperator*need\usepackage{amsmath}.MathJax and KaTeX
MathJax and KaTeX render
\lim,\limsup,\liminf,\limitsand\operatorname*without setup. Inline math in Markdown ($…$) puts the condition to the side, just as LaTeX does.Microsoft Word
Word has a “lim” template under Function, but pasted LaTeX is not converted reliably. Write the limit here and use Copy for Word to paste an editable Word equation.
Limit in LaTeX: questions
- How do I put x → 0 under lim?
- Write it as a subscript:
\lim_{x \to 0}. It appears underneath in displayed equations; for inline math add\limits:\lim\limits_{x \to 0}. - How do I write a limit approaching infinity?
- Use
\infty:\lim_{x \to \infty} f(x). For negative infinity writex \to -\infty. - How do I write a one-sided limit?
- Add a plus or minus superscript to the value:
\lim_{x \to a^{+}}for the right-hand limit and\lim_{x \to a^{-}}for the left-hand one. - Is \to the same as \rightarrow?
- Yes, both draw →.
\tois the conventional choice in limits because it is short and says what it means.
Related LaTeX reference
- Infinity in LaTeXThe ∞ symbol with \infty: negative infinity, intervals, limits to infinity, infinite sums and integrals.
- How to Write an Arrow in LaTeXRight, left, double, long, maps-to and labeled arrows (\to, \Rightarrow, \xrightarrow), plus arrows in text mode.
- Summation in LaTeX\sum with limits, why inline sums put the limits beside the sigma, \limits and \displaystyle, and multi-line conditions with \substack.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX