Stage 3 · Mathematics 22 / 48 ≈ 15 min read

LaTeX Limits: lim, to and Infinity Notation

What \lim is as a TeX object, where its condition goes in each style, how to write one-sided and multivariable limits, and which of the surrounding operators — limsup, max, argmin, projlim — behave the same way.

    What \lim is, and why its condition moves

    \lim is not a symbol with two slots of its own; it is a math operator — the same category of thing as \max and \sum — declared in the LaTeX kernel as an upright name inside \mathop. An operator with no explicit limit flag takes TeX's default, and that default is the whole mechanism: in display style the subscript goes underneath and the superscript on top, because there is no line of text to protect; in text style both move to the side, because a stacked condition would be taller than the surrounding type. amsmath exposes the two defaults as the postfix switches \displaylimits and \nolimits, and the kernel uses \nolimits for names like \sin, which is why they never collect a limit.

    So the difference you see between $\lim_{n \to \infty} a_n$ in a paragraph and \[ \lim_{n \to \infty} a_n \] on its own line is not a formatting accident and not something to "fix". Two commands override the default per occurrence: \lim\limits_{n \to \infty} forces the stack even inline (you pay the leading), and \lim\nolimits_{n} forces side placement even in a display, which is a real typographic choice when the condition is short and the derivation is dense.

    The size of the condition never changes with the position: in both cases it is set in scriptstyle. That is why \lim_{x \to a^{+}} \frac{f(x)-f(a)}{x-a} gets unreadably small if you keep adding structure inside the subscript — the limit slot is for a phrase, not for a paragraph.

    \lim_{x \to a} f(x) = L
    \lim_{x \to a} f(x) = L
    \lim_{n \to \infty} a_n \qquad \lim\limits_{n \to \infty} a_n \qquad \lim_{h \to 0^{+}} \frac{1}{h}
    \lim_{n \to \infty} a_n \qquad \lim\limits_{n \to \infty} a_n \qquad \lim_{h \to 0^{+}} \frac{1}{h}
    Where the condition of a limit goes in inline versus display maths, and how \limits, \nolimits and \substack change it \lim is a \displaylimits operator: it stacks in display, hugs the side in text style inline — text style lim x→0 = 1 the condition sits under the name, at the side, in scriptstyle: never breaks the line band $\lim_{x \to 0} \frac{\sin x}{x} = 1$ display — display style lim x→0 = 1 centred under the operator, still scriptstyle, because amsmath marks \lim with \displaylimits — display has no line to protect \[ \lim_{x \to 0} \frac{\sin x}{x} = 1 \] Two overrides, both legal \lim\nolimits_{n} a_n \qquad \lim\limits_{x \to 0^{+}} f(x) \nolimits keeps a display compact; \limits stacks inline — pay the line-height A limit that needs two lines of condition lim x→0 y→∞ f(x, y) \lim_{\substack{x \to 0 \\ y \to \infty}} f(x,y) \substack stacks conditions and keeps them centred The reading trap nobody warns you about \lim_{x \to \infty} f(x) = 0 \quad \text{as } n \to \infty Two variables, one dead: the trailing as-clause belongs to nothing. Put the condition on the operator that uses it, and never let \lim and the equals sign compete for the reader. f(x) \to 0 \text{ as } x \to \infty
    The same \lim in text style and in display style, plus the two override commands and what each one costs.

    Braces: the condition is a single argument

    The subscript slot obeys the one-token rule like every other slot in maths. \lim_x puts a lone x under \lim; \lim_{x \to 0} puts the whole phrase there. The failure is silent and specific: \lim_x \to 0 f(x) compiles, produces a subscript x and then prints \to 0 at full height as a relation in the main line — a formula that says something you did not write, and looks plausible at a glance. It is the most common limit error in student LaTeX, precisely because the output is not ugly, just wrong.

    The same trap catches the value side. \lim_{n \to \infty} \frac{3n^{2}+1}{n^{2}-5} = 3 is a statement about a sequence; \lim_{n \to \infty} = 3 with the expression missing (a habit from handwriting, where the limit sign visually "carries" the expression) is a legal TeX construction and a nonsense sentence. If you want the expression off the operator, drop the operator: \frac{3n^{2}+1}{n^{2}-5} \to 3 as n \to \infty is shorter, reads better inline, and cannot lose its operand.

    Braces also nest: \lim_{n \to \infty} \lim_{m \to \infty} a_{n,m} is two operators each with one braced condition — not \lim_{n,m \to \infty}, which is a different (and rarer) assertion.

    \lim_{n \to \infty} \frac{3n^{2}+1}{n^{2}-5} = 3 \qquad \lim_{x \to 0^{+}} \frac{1}{x} = +\infty
    \lim_{n \to \infty} \frac{3n^{2}+1}{n^{2}-5} = 3 \qquad \lim_{x \to 0^{+}} \frac{1}{x} = +\infty
    \lim_{x \to a} f(x) = L \qquad f(x) \to L \text{ as } x \to a
    \lim_{x \to a} f(x) = L \qquad f(x) \to L \text{ as } x \to a

    The arrow: to, rightarrow, and directions of approach

    \to and \rightarrow are two names for the same math character — same glyph, same spacing class, pick one per document for consistency. \longrightarrow is longer and is usually wrong inside a limit condition, where it makes the subscript wider than the operator it belongs to; it earns its place as a label carrier, as in a_n \xrightarrow{n \to \infty} a, which reads "a sub n converges to a" with the mode of convergence written on the arrow.

    Direction is encoded in the symbol. x \to a^{+} and x \to a^{-} are the one-sided limits, and the superscript belongs to a, not to the arrow, so \lim_{x \to 0^{+}} is the braced form. x \nearrow a, x \searrow a, x \uparrow and x \downarrow assert monotonicity as well as a limit, which is a real mathematical claim: use them only when the sequence or parameter genuinely increases. In probability and statistics, \xrightarrow{p} and \xrightarrow{d} for convergence in probability and in distribution are conventional and much clearer than a \text{…} note.

    A related distinction that people flatten: \mapsto maps an element to its image (f \colon x \mapsto x^{2}), while \to maps a space to a space (f \colon \mathbb{R} \to \mathbb{R}). Writing f : x \to x^{2} for a rule is a notation error a referee will mark, independent of the spacing.

    x \to \infty \qquad x \to -\infty \qquad x \to a^{-} \qquad x \nearrow a \qquad x \downarrow a
    x \to \infty \qquad x \to -\infty \qquad x \to a^{-} \qquad x \nearrow a \qquad x \downarrow a
    a_n \xrightarrow{n \to \infty} a \qquad a_n \overset{n \to \infty}{\longrightarrow} a \qquad a_n \to a
    a_n \xrightarrow{n \to \infty} a \qquad a_n \overset{n \to \infty}{\longrightarrow} a \qquad a_n \to a
    \documentclass[11pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath,amssymb}
    
    % A labelled arrow: the mode of convergence goes over the arrow, not in \text{}
    \newcommand{\asto}{\xrightarrow{\;a \to \infty\;}}
    \newcommand{\wpconv}{\xrightarrow{\;\mathrm{p}\;}}
    \DeclareMathOperator*{\esssup}{ess\,sup}
    
    \title{Arrows, limits and honest infinity}
    \author{A. Student}
    \date{\today}
    
    \begin{document}
    \maketitle
    
    \section{The same character, three names}
    \[
      x \to \infty \qquad x \rightarrow \infty \qquad x \longrightarrow \infty
    \]
    The first two are identical in output; the long form only pays for itself
    when it carries a label, as in \(a_n \asto a\).
    
    \section{Direction of approach}
    \[
      x \to 0^{+}, \quad x \to 0^{-}, \quad a_n \nearrow a, \quad b_n \downarrow b
    \]
    The last two assert monotonicity, so use them only when the sequence is in
    fact increasing or decreasing --- they are claims, not decorations.
    
    \section{Divergence, in words}
    Writing \(\lim_{x \to 0} 1/x = \infty\) hides a sign disagreement between
    the one-sided limits. Say what happens:
    \[
      \lim_{x \to 0^{+}} \frac{1}{x} = +\infty,
      \qquad
      \lim_{x \to 0^{-}} \frac{1}{x} = -\infty,
      \qquad
      \lim_{x \to 0} \frac{1}{x} \text{ does not exist}.
    \]
    
    \end{document}

    Two conditions, and limits of several variables

    A limit that needs a pair of conditions should stack them, and amsmath gives exactly one tool that does it inside the subscript slot: \substack. \lim_{\substack{x \to a \\ y \to b}} f(x,y) centres both lines, sets them in scriptstyle, and keeps the whole block inside the limit slot so that \lim still behaves as an operator. The variant \begin{subarray}{l}…\end{subarray} does the same job left-aligned, which is what you want when the lines share a prefix and you want the differing tails to line up.

    The alternative is to make the approach a single statement about a point: \lim_{(x,y) \to (0,0)}. That is the honest form for a multivariable limit, because it says "along every path", whereas a \substack of two independent conditions says something subtly different (the two variables tend separately, not jointly). Mixing them up is a mathematics error that LaTeX will typeset for you without complaint.

    What to avoid is \underset{n \to \infty}{\lim}, which people discover as a way to force stacking. It is not equivalent: \underset builds an ordinary symbol with an under-thing out of \lim, so the result loses its operator class — the spacing on either side changes to relation-class glue, the centring of the condition relative to the name is decided by the width of the whole construction, and \limits afterwards no longer does anything. \lim\limits_{n \to \infty} does the same job correctly.

    \lim_{\substack{x \to a \\ y \to b}} f(x,y) \qquad \lim_{(x,y) \to (0,0)} \frac{xy}{x^{2}+y^{2}}
    \lim_{\substack{x \to a \\ y \to b}} f(x,y) \qquad \lim_{(x,y) \to (0,0)} \frac{xy}{x^{2}+y^{2}}
    Same construct on the other big operators: \iint\limits_{\substack{0 \le t \le T \\ x \in \Omega}}, and \sum_{\substack{i+j=n \\ i,j \ge 0}}.

    The operators that behave like lim

    Knowing the family saves you from hand-stacking anything. \limsup and \liminf are predefined and take conditions exactly like \lim; \varlimsup and \varliminf are the AMS-style variants that always put the condition underneath, in every style, and exist because some journals set the two forms differently. \sup, \inf, \max, \min are \displaylimits operators, so \max_{1 \le i \le n} a_i stacks in a display and side-sets inline — the same automatic behaviour, no \limits needed. \injlim and \projlim from amsmath give direct and inverse limits, and are declared with the star so they always stack in a display.

    Names that are not in the list are your job. A single occurrence: \operatorname*{arg\,min}_{x \in C} f(x) — the star is what buys limit-stacking, and the \, inside is what keeps the two words from setting as one. Document-wide, declare it once in the preamble: \DeclareMathOperator*{\argmin}{arg\,min}. Without the star you get the same name in upright type whose condition hangs at the side forever, which is how "arg min over a set" ends up looking like a subscript accident.

    Two failure modes are worth recognising in someone else's source. \arg\min_{x} is two operators glued together, and the condition attaches to \min only, so the name prints as "arg" followed by a stacked min — wrong at every level. And \mathrm{arg\,min}_{x} is an ordinary atom, so the condition sits at the side in a display and looks smaller than it should; \limits after it is not merely ugly, it is an outright error: "Limit controls must follow a math operator".

    \varlimsup_{n \to \infty} a_n \qquad \varinjlim_{i} A_i \qquad \projlim_{n} X_n
    \varlimsup_{n \to \infty} a_n \qquad \varinjlim_{i} A_i \qquad \projlim_{n} X_n
    \max_{1 \le i \le n} a_i \qquad \sup_{x \in D} f(x) \qquad \operatorname*{arg\,min}_{x \in C} f(x)
    \max_{1 \le i \le n} a_i \qquad \sup_{x \in D} f(x) \qquad \operatorname*{arg\,min}_{x \in C} f(x)
    Operator family table: which LaTeX operators stack their limits in display maths, which never do, and how to flip each one The behaviour is a property of the operator, decided once in the package source OPERATOR CLASS DISPLAY STYLE TEXT STYLE ∑ \sum \prod \bigcup \bigoplus large operator stacked, centred under side, in $ … $ ∫ \int \iint \iiint \oint operator, \nolimits by default always side — TeX never stacks it side lim \lim \limsup \max \sup \inf operator, default limits stacked side sin \sin \log \det \gcd \exp operator + \nolimits side: \nolimits is what keeps \sin _{2} off the floor side (\sin^{2} x is a power, not a limit) arg min \operatorname{arg\,min} plain \mathop, no limit flag side unless you write \limits or * side Flipping the default \sum_{n} \quad \sum\nolimits_{n} \quad \int\limits_{a}^{b} \limits / \nolimits follow the operator and apply to that one occurrence only \DeclareMathOperator*{\argmin}{arg\,min} the star in the preamble makes stacking the default for every later use of that name
    Which operators stack their conditions in display maths, which never do, and how to flip each one.

    Infinity: what the symbol is allowed to claim

    \infty is a bound, not a number, and the typography follows that. x \to \infty says how the variable grows; +\infty and -\infty distinguish the two ends of the extended line, which is why \overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty, +\infty\} is the right way to introduce them. Never treat the symbol as arithmetic material in a displayed line: \infty - \infty, cancelling an \infty across a fraction, or \frac{\infty}{\infty} all set beautifully and mean nothing; the indeterminate forms belong in a limit, where the arrow tells you what is tending.

    The statement \lim_{x \to 0} \frac{1}{x} = \infty is where notation and mathematics disagree: the two one-sided limits have opposite signs, so the correct facts are \lim_{x \to 0^{+}} \frac{1}{x} = +\infty, \lim_{x \to 0^{-}} \frac{1}{x} = -\infty, and the unqualified limit does not exist. Writing "= \infty" for divergence is a convention some fields use and others reject; either is fine, but say which you mean the first time, and do not mix it with an \to in the same display.

    Do not confuse \infty with the cardinal symbols. \aleph_0 is the size of \mathbb{N} and has no business as a limit of a sequence of real numbers; \omega is an ordinal in set theory and a frequency in physics, and in either use it is a name, not a bound. Both are ordinary symbols to TeX, so nothing will warn you.

    \overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty, +\infty\}
    \overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty, +\infty\}
    \sum_{n=1}^{\infty} a_n \text{ converges} \implies a_n \to 0
    \sum_{n=1}^{\infty} a_n \text{ converges} \implies a_n \to 0

    Quantifiers, epsilon and the spacing a definition needs

    An epsilon-delta definition is a wall of short clauses, and its readability is a spacing question. The quantifiers \forall \varepsilon \gt 0 and \exists \delta \gt 0 are relations with each other, so TeX already puts thick glue between them; a \; before \text{such that} or before a colon keeps the logical part from running into the verbal part. Use \varepsilon and \delta rather than \epsilon and \varphi-style alternates inconsistently — the choice is free, the inconsistency is visible, and \varepsilon is the lunate form most analysis texts use.

    The implication arrow \Rightarrow (or \implies, which adds space) separates the hypothesis from the conclusion in one displayed line; where you would write a comma in English, put \; or \quad in the maths, never a typed blank. If the line is that long, it wants to be an aligned or gathered block instead, with the condition on the first row and the inequality on the second.

    A colon used inside such a definition is punctuation in TeX's eyes — \{x \in \mathbb{R} : x \gt 0\} sets the colon tight against the symbol before it. The relation-class \mid gives the balanced spacing a separator wants, and \colon exists for maps; both are covered in the spacing lesson, and both are usually what a "reads badly" line is actually missing.

    \forall \varepsilon > 0 \; \exists \delta > 0 \; \text{such that} \; 0 \lt \lvert x - a \rvert \lt \delta \Rightarrow \lvert f(x) - L \rvert \lt \varepsilon
    \forall \varepsilon > 0 \; \exists \delta > 0 \; \text{such that} \; 0 \lt \lvert x - a \rvert \lt \delta \Rightarrow \lvert f(x) - L \rvert \lt \varepsilon

    Writing a limit so a reader parses it once

    Three rules account for almost every well-typeset limit in a paper. Put the condition on the thing that is tending, not at the end of the line: \lim_{n \to \infty} a_n, not \lim a_n, \; n \to \infty. In running text, prefer the arrow form f(x) \to L as x \to a — it stays on the baseline, costs no leading, and reads as a sentence. And when a limit is only one step of a derivation, repeat the operator on each row of the aligned block rather than leaving a dangling = \lim that makes the reader carry the condition downward across lines.

    Where you do keep the stacked form in a display, check the tail: \lim_{n \to \infty} \left(1 + \frac{x}{n}\right)^{n} = e^{x} has an auto-sized parenthesis whose height is set by the fraction, and the whole thing sits one storey taller than the limit sign. That is fine in a display and one of the reasons the same line should not be used inline; the inline version of the same identity is (1 + x/n)^{n} \to e^{x}, which is both shorter and more legible at text size.

    Finally, "as n \to \infty" written as prose inside a display needs \text{as } n \to \infty — with the space inside the braces, because outside them it is discarded. This tiny detail is the difference between "as n→∞" and "asn→∞", and it is worth checking every time you put words into maths.

    \left(1 + \frac{x}{n}\right)^{n} \to e^{x} \quad \text{as } n \to \infty
    \left(1 + \frac{x}{n}\right)^{n} \to e^{x} \quad \text{as } n \to \infty
    \documentclass[11pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath,amssymb}
    
    % A new operator whose condition must stack: the star is the declaration
    \DeclareMathOperator*{\esssup}{ess\,sup}
    \DeclareMathOperator{\supp}{supp}
    \DeclareMathOperator{\plim}{plim}   % no star: the condition always sits at the side
    
    \title{Limits: notation and typography}
    \author{A. Student}
    \date{\today}
    
    \begin{document}
    \maketitle
    
    \section{Display and inline}
    In a display the condition goes underneath:
    \[
      \lim_{x \to 0} \frac{\sin x}{x} = 1.
    \]
    In running text the same source keeps it at the side, and that is the
    behaviour you want --- forcing \verb|\lim\limits| inline opens the line.
    Where the sentence is long, prefer the narrative form: as \(x \to \infty\),
    \(f(x) \to 0\).
    
    \section{One-sided and multivariable limits}
    \[
      \lim_{x \to 0^{+}} \ln x = -\infty,
      \qquad
      \lim_{\substack{(x,y) \to (0,0) \\ x \ne y}} \frac{xy}{x - y} \text{ does not exist}.
    \]
    
    \section{Definitions with quantifiers}
    \[
      \forall \varepsilon > 0 \; \exists N \in \mathbb{N} \; \forall n > N
      \; : \; \lvert a_n - a \rvert \lt \varepsilon .
    \]
    The \verb|\;| between quantifiers is a thick space; a \verb|:| alone is
    punctuation and will hug the symbol before it.
    
    \section{Limits inside an aligned derivation}
    \begin{align}
      \frac{\mathrm{d}}{\mathrm{d}x} x^{2}
        &= \lim_{h \to 0} \frac{(x+h)^{2} - x^{2}}{h} \notag \\
        &= \lim_{h \to 0} (2x + h) = 2x.
    \end{align}
    Note that \verb|\lim| is repeated on the second line rather than written
    as an empty \verb|&= \lim| --- a bare operator with no operand is legal
    TeX and a reading error for the reader.
    
    \end{document}

    Lesson cheat sheet

    One key line of code from each section — jump to it or copy it straight from here.

    Section Key code
    \lim_{x \to a} f(x) = L
    \lim_{n \to \infty} \frac{3n^{2}+1}{n^{2}-5} = 3 \qquad \lim_{x \to 0^{+}} \frac{1}{x} = +\infty
    \documentclass[11pt,a4paper]{article}
    \lim_{\substack{x \to a \\ y \to b}} f(x,y) \qquad \lim_{(x,y) \to (0,0)} \frac{xy}{x^{2}+y^{2}}
    \varlimsup_{n \to \infty} a_n \qquad \varinjlim_{i} A_i \qquad \projlim_{n} X_n
    \overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty, +\infty\}

    Common mistakes

    • \lim_x \to 0 f(x): the condition is a multi-token phrase, so it needs braces. Without them \to 0 prints at full height in the main line and the statement means something else.
    • Typing lim_{x \to 0} without the backslash: three italic variables multiplied, side-set subscript, and no upright operator name.
    • \underset{n \to \infty}{\lim} used to force stacking. It changes the atom class, off-centres the condition and makes \limits afterwards meaningless; \lim\limits_{n \to \infty} is the correct construction.
    • \arg\min_{x} or \mathrm{arg\,min}_{x} for a two-word name. Use \operatorname*{arg\,min}_{x} once, or \DeclareMathOperator*{\argmin}{arg\,min} in the preamble.
    • Reaching for \lim\limits inside a sentence to make the formula match the display above it. The stack cannot fit the line, so TeX widens the leading: use the arrow form inline.
    • \lim_{x \to 0} \frac{1}{x} = \infty stated without one-sided limits. The signs disagree, so the two-sided limit does not exist — say that, or write x \to 0^{+}.
    • Writing = \infty for "the sequence grows without bound" in one paragraph and the word "diverges" in the next: pick a convention, state it once, and keep the arrow form out of the same display.

    Questions about this lesson

    How do I get x → 0 underneath lim in LaTeX?
    Write \lim_{x \to 0} f(x) inside a displayed formula — the condition goes underneath automatically, because \lim is a \displaylimits operator. In inline maths it stays at the side by design; \lim\limits_{x \to 0} forces the stack but makes the line taller, so use it sparingly.
    Why does my limit arrow print next to lim instead of under it?
    Two causes. Either you are typesetting inline, where \lim keeps its condition at the side by design, or you forgot the braces: \lim_x \to 0 f(x) puts only the x underneath and prints the arrow at full height in the main line. Write \lim_{x \to 0} f(x), and use \lim\limits if you want the stacked form inside a sentence.
    What is the difference between \to and \rightarrow?
    None — they are two names for the same character, with the same spacing. \longrightarrow is a longer arrow and is mostly useful as a label carrier in \xrightarrow{n \to \infty}; using it inside a limit condition makes the subscript wider than the operator.
    How do I write a left-hand or right-hand limit in LaTeX?
    Put the side on the point, not on the arrow: \lim_{x \to 0^{+}} f(x) and \lim_{x \to 0^{-}} f(x). If you need the monotone-approach notation, x \nearrow a and x \downarrow a assert that the variable increases or decreases toward the limit as well.
    How do I typeset limsup and liminf?
    \limsup and \liminf are predefined and take a condition exactly like \lim. \varlimsup and \varliminf are the AMS variants that always stack the condition, in text style as well as display, which is what some journals ask for.
    How do I write a limit with two conditions under it?
    Use amsmath's \substack inside the subscript: \lim_{\substack{x \to a \\ y \to b}}. It keeps the lines centred and in scriptstyle and leaves \lim as an operator. For a genuine two-variable limit, however, \lim_{(x,y) \to (0,0)} is the mathematically correct form.

    Live playground: edit the LaTeX, see it render

    The preview updates as you type — break it on purpose to see how errors look.

    KaTeX error
    Try an example

    Keep reading

    Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.