Articles Latex limit

LaTeX Limits and Mathematical Notation: Complete Guide for Calculus and Analysis

Typeset LaTeX limits, derivatives, integrals, and series the right way. A calculus and analysis notation guide with the packages each command needs and common placement fixes.

inscrive.io · Jan 30, 2025 · 14 min read
LaTeX Limits and Mathematical Notation: Complete Guide for Calculus and Analysis

LaTeX Limits and Mathematical Notation: Complete Guide for Calculus and Analysis

Calculus lives or dies on notation, and LaTeX limits, derivatives, and integrals are where the system earns its reputation. Get the commands right and your analysis reads cleanly. Get them wrong and limits sit beside the operator instead of beneath it, differentials crowd the integrand, and reviewers notice. This guide walks through limit notation in LaTeX and the surrounding calculus toolkit, with the package each piece needs and the spots where the obvious command isn’t the standard one.

Understanding Limits in LaTeX

Basic Limit Notation

% Inline limit
$\lim_{x \to a} f(x) = L$

% Display style
\[ \lim_{x \to a} f(x) = L \]

% Force display placement inline
$\displaystyle\lim_{x \to a} f(x) = L$

In display math, the subscript on \lim drops below the word, which is what you want. Inline, LaTeX moves it to the side to save vertical space. \displaystyle overrides that when you need the limit underneath even in running text.

Limit Variations

% One-sided
\lim_{x \to a^+} f(x)
\lim_{x \to a^-} f(x)

% At infinity
\lim_{x \to \infty} f(x)
\lim_{x \to -\infty} f(x)

% With a condition (needs amsmath for \substack)
\lim_{\substack{x \to 0 \\ x > 0}} \frac{\sin x}{x}

% Multivariable
\lim_{(x,y) \to (0,0)} \frac{xy}{x^2 + y^2}

Advanced Limit Notation

% Supremum and infimum limits (amsmath)
\limsup_{n \to \infty} a_n
\liminf_{n \to \infty} a_n

% Direct and inverse limits (amsmath)
\varprojlim_{n} X_n
\varinjlim_{n} X_n

\varprojlim and \varinjlim come from amsmath and give the proper “lim” with an arrow underneath for projective and injective limits.

Derivatives and Differentials

Basic Derivatives

% First derivative
f'(x)
\frac{df}{dx}
\frac{d}{dx}f(x)
\dot{x}       % Newton's notation
D_x f         % Operator notation

% Higher order
f''(x)
f^{(n)}(x)
\frac{d^2 f}{dx^2}
\frac{d^n f}{dx^n}

Partial Derivatives

\frac{\partial f}{\partial x}
\partial_x f
f_x

% Mixed partials
\frac{\partial^2 f}{\partial x \partial y}
\frac{\partial^3 f}{\partial x^2 \partial y}

The physics package adds shorthand if you load it:

\usepackage{physics}
\dv{f}{x}      % Derivative
\pdv{f}{x}     % Partial derivative
\dv[2]{f}{x}   % Second derivative
\pdv{f}{x}{y}  % Mixed partial

A caution on physics: it redefines some common commands (\div, \Re, and others) and can clash with other packages. Convenient, but test it against the rest of your preamble.

Derivative at a Point

% Evaluation bar
\left.\frac{df}{dx}\right|_{x=a}
\frac{df}{dx}\bigg|_{x=a}

% Restricted, holding a variable constant
\left(\frac{\partial f}{\partial x}\right)_{y=\text{const}}

The \left. ... \right| pattern gives an invisible left delimiter so only the bar shows, sized to the fraction.

Integrals

Definite and Indefinite

\int f(x) \, dx                    % Indefinite
\int_a^b f(x) \, dx                % Definite
\int\limits_a^b f(x) \, dx         % Limits stacked above and below

% Multiple integrals (amsmath)
\iint_D f(x,y) \, dA
\iiint_V f(x,y,z) \, dV
\idotsint_{\Omega} f \, d\mu

% Line and surface integrals
\oint_C \vec{F} \cdot d\vec{r}     % Closed line integral

The \, before each differential is a thin space. Without it, dx butts against the integrand and looks wrong. With it, the integral reads the way it should.

Average and Principal Value Integrals

These need extra packages. The esint package adds extended integral signs:

\usepackage{esint}
\oiint_S \vec{F} \cdot d\vec{S}    % Closed surface integral
\fint_a^b f(x) \, dx               % Average (slashed) integral

For a Cauchy principal value, the clearest portable approach is plain text:

\text{P.V.} \int_{-\infty}^{\infty} \frac{f(x)}{x} \, dx

Summations and Products

% Sum
\sum_{i=1}^{n} a_i

% Limits on the side, inline
\sum\nolimits_{i=1}^{n} a_i

% Multiple indices (amsmath)
\sum_{\substack{i=1 \\ j=1}}^{n} a_{ij}

% Infinite series
\sum_{n=0}^{\infty} \frac{1}{n!}

% Products and big operators
\prod_{i=1}^{n} a_i
\coprod_{i=1}^{n} a_i
\bigoplus_{i=1}^{n} V_i
\bigcup_{i=1}^{n} A_i
\bigcap_{i=1}^{n} A_i

\sum_{...} stacks the index below in display mode and beside it inline. Use \nolimits to force the inline behavior anywhere, or \limits to force stacking.

Special Functions and Operators

Trigonometric and Hyperbolic Functions

\sin x, \cos x, \tan x
\sec x, \csc x, \cot x
\arcsin x, \arccos x, \arctan x
\sinh x, \cosh x, \tanh x

% Squared and inverse
\cos^2 x
\sin^{-1} x

These predefined operators render upright with correct spacing, so \sin x looks right where sin x would be three italic variables. There is no built-in \arcsinh. Define it yourself:

\DeclareMathOperator{\arcsinh}{arcsinh}
$\arcsinh x$

Logarithms and Exponentials

\ln x
\log x
\log_a x

e^x
\exp(x)
\exp\left(\frac{-x^2}{2}\right)

% The classic limit
\lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n = e

Complex Analysis Notation

% Real and imaginary parts
\Re(z), \Im(z)

% Conjugate and modulus
\bar{z}, \overline{z}
|z|, \lvert z \rvert

% Argument (define the principal-value form)
\arg(z)
\DeclareMathOperator{\Arg}{Arg}
$\Arg(z)$

For residues, declare the operator so it gets a subscript in the right place:

\DeclareMathOperator*{\Res}{Res}
$\Res_{z=z_0} f(z)$

Sequences and Series

% Convergence
a_n \to L \text{ as } n \to \infty
a_n \xrightarrow{n \to \infty} L   % needs amsmath

% Series convergence
\sum_{n=1}^{\infty} a_n \text{ converges}
\sum a_n < \infty

% Uniform convergence
f_n \rightrightarrows f

\xrightarrow from amsmath puts a label above the arrow, which is the standard way to annotate the kind of convergence.

% Taylor series
f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n

% Fourier series
f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}
       \left[a_n \cos(nx) + b_n \sin(nx)\right]

Vector Calculus

% Gradient, divergence, curl
\nabla f
\nabla \cdot \vec{F}
\nabla \times \vec{F}

% Laplacian
\nabla^2 f
\Delta f

% Line, surface, volume integrals
\int_C \vec{F} \cdot d\vec{r}
\iint_S \vec{F} \cdot \hat{n} \, dS
\iiint_V \nabla \cdot \vec{F} \, dV

Optimization and Constraints

\min_{x \in \mathbb{R}} f(x)
\max_{x \in S} g(x)
\arg\min_{x} f(x)
\arg\max_{x} g(x)

% Constrained problem
\begin{align}
\min_{x,y} \quad & f(x,y) \\
\text{s.t.} \quad & g(x,y) \leq 0 \\
                  & h(x,y) = 0
\end{align}

\sup_{x \in A} f(x)
\inf_{x \in A} f(x)

For \argmin and \argmax to put their subscript underneath in display mode, declare them with the starred form:

\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}

Functional Analysis

% Norms
\|x\|
\|x\|_2
\|x\|_{\infty}
\|f\|_{L^p}

% Inner products
\langle x, y \rangle
\langle x | y \rangle   % Dirac notation

% Operators
\mathcal{L}[f]
\hat{H}\psi

% Functional derivatives
\frac{\delta F}{\delta f}

Best Practices for Mathematical Typography

Spacing

\int f(x) \, dx      % Thin space before dx
\sin x \cos x        % Automatic spacing between operators
a \cdot b            % Centered multiplication dot

% Manual control
\!    % Negative thin space
\,    % Thin space
\;    % Thick space
\quad % Em space

Breaking Long Equations

% Multi-line limit condition (amsmath)
\lim_{\substack{n \to \infty \\ n \text{ even}}} a_n

% Split a long line (amsmath)
\begin{multline}
f(x) = a_0 + a_1 x + a_2 x^2 + \cdots \\
+ a_{n-1} x^{n-1} + a_n x^n
\end{multline}

Common Mistakes and Fixes

Limit Placement

% Avoid forcing limits to the side in display mode
\[ \lim\nolimits_{x \to 0} f(x) \]

% Let LaTeX decide
\[ \lim_{x \to 0} f(x) \]

% Or force stacking when you need it
\[ \lim\limits_{x \to 0} f(x) \]

Differential Notation

% Cluttered
\frac{df}{dx}(x)

% Clearer
\frac{df}{dx} \bigg|_{x=a}   % At a point
\frac{d}{dx}\bigl[f(x)\bigr] % Of an expression

Reusable Macros

% In the preamble
\newcommand{\limzero}[1]{\lim_{#1 \to 0}}
\newcommand{\liminfty}[1]{\lim_{#1 \to \infty}}

% Number only referenced equations (needs mathtools)
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}

% Custom equation tag
\begin{equation}\tag{Euler}
e^{i\pi} + 1 = 0
\end{equation}

Macros pay off when the same limit shape appears across a long document. Define it once, and a notation change touches one line.

Writing Calculus Documents in the Browser

Math-heavy documents reward a fast feedback loop. Type a limit, see it render, fix the spacing, move on. A browser-based editor gives you that without a local TeX install, and packages like amsmath, physics, and esint are already available.

inscrive.io is a collaborative online LaTeX editor with a rendered preview beside the source, so a misplaced subscript or a limit on the wrong side shows up immediately. The free tier (€0, no credit card) covers up to 10 active projects, unlimited collaborators, version history to rewind a formula, and a 60-second compile window. It is hosted in the EU on Hetzner servers in Germany and Finland under ISO 27001 certification, with a signed DPA available for institutions, and it never uses your documents to train AI models. Real-time collaboration means a co-author can work the same proof with you, with no merge conflicts. For the wider math toolkit, see LaTeX Math Mode Mastery, and for first steps, the LaTeX beginner guide.

Good notation is about clarity as much as correctness. Use these commands so your calculus reads as cleanly as it computes.

Typesetting calculus and want instant feedback? Try inscrive.io for collaborative LaTeX with live preview, free to start.

Sign up for our newsletter

Roadmap progress, announcements and exclusive discounts — straight to your inbox.

We care about the protection of your data. Read our privacy policy.