Octree LogoOctree

Integrals, Sums and Limits in LaTeX

Integrals, summations, and limits are cornerstone math constructs used throughout calculus, analysis, and applied mathematics. LaTeX provides powerful commands for typesetting each of these with precise control over notation, bounds placement, and display style.

Basic Integrals

The \int command produces the integral sign. You can add lower and upper bounds with subscript and superscript syntax to create definite integrals, or omit them for indefinite integrals.

% Indefinite integral
$\int f(x) \, dx$

% Definite integral from a to b
$\int_a^b f(x) \, dx$

% Display-style definite integral
\[
  \int_0^\infty e^{-x} \, dx = 1
\]

% Definite integral with evaluated bounds
\[
  \int_0^1 x^2 \, dx = \left[ \frac{x^3}{3} \right]_0^1 = \frac{1}{3}
\]

The thin space \, before dx is a standard convention that improves readability. In inline mode, bounds appear to the side of the integral sign; in display mode, they appear above and below.

Multiple Integrals

LaTeX and the amsmath package provide commands for double, triple, and contour integrals. These are essential for multivariable calculus, physics, and engineering.

\usepackage{amsmath}

% Double integral
\[
  \iint_D f(x,y) \, dA
\]

% Triple integral
\[
  \iiint_V f(x,y,z) \, dV
\]

% Contour integral (closed path)
\[
  \oint_C \mathbf{F} \cdot d\mathbf{r}
\]

% Surface integral
\[
  \iint_S \mathbf{F} \cdot d\mathbf{S}
\]

% Volume integral with specific bounds
\[
  \iiint_V \rho(x,y,z) \, dx \, dy \, dz
\]

Integral Variations

The following table summarises the integral commands available with theamsmath package:

CommandOutputDescription
\intSingle integral signStandard integral
\iintDouble integral signDouble integral (amsmath)
\iiintTriple integral signTriple integral (amsmath)
\ointContour integral signClosed path / contour integral
\oiintClosed surface integral signClosed surface integral (amsmath / esint)
\idotsintIntegral with dotsMultiple integral with dots (amsmath)

Summations

The \sum command typesets the capital sigma used in summation notation. Subscripts and superscripts control the lower and upper bounds of the sum.

% Basic summation
$\sum_{i=1}^{n} a_i$

% Display-style summation
\[
  \sum_{i=1}^{n} i = \frac{n(n+1)}{2}
\]

% Double summation
\[
  \sum_{i=1}^{m} \sum_{j=1}^{n} a_{ij}
\]

% Summation with conditions
\[
  \sum_{\substack{i=1 \\ i \neq j}}^{n} a_i
\]

% Inline vs display comparison
Inline: $\sum_{i=1}^{n} x_i$ places limits to the side.

Display:
\[
  \sum_{i=1}^{n} x_i \quad \text{places limits above and below.}
\]

In inline mode LaTeX places the bounds to the right of the sigma to keep the line height compact. In display mode (between \[ and \] or inside equation), limits appear above and below by default.

Products

The \prod command renders the product symbol (capital pi). It works exactly like \sum for bound placement.

% Basic product
$\prod_{i=1}^{n} a_i$

% Display-style product
\[
  \prod_{i=1}^{n} i = n!
\]

% Factorial definition
\[
  n! = \prod_{k=1}^{n} k
\]

% Infinite product
\[
  \prod_{n=1}^{\infty} \left(1 - \frac{x^2}{n^2 \pi^2}\right) = \frac{\sin x}{x}
\]

Limits

The \lim command typesets the "lim" operator in upright Roman text with the subscript expression placed below (in display mode) or beside (inline).

% Basic limit
$\lim_{x \to a} f(x)$

% Limit at infinity
\[
  \lim_{x \to \infty} \frac{1}{x} = 0
\]

% One-sided limits
\[
  \lim_{x \to 0^+} \frac{1}{x} = +\infty
  \qquad
  \lim_{x \to 0^-} \frac{1}{x} = -\infty
\]

% Limit superior and limit inferior
\[
  \limsup_{n \to \infty} a_n
  \qquad
  \liminf_{n \to \infty} a_n
\]

% Limit definition of derivative
\[
  f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}
\]

% Limit definition of e
\[
  e = \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n
\]

Controlling Limits Placement

By default, LaTeX places limits above/below big operators in display mode and to the side in inline mode. You can override this behaviour with \limits,\nolimits, and \displaystyle.

% Force limits above/below in inline mode
$\sum\limits_{i=1}^{n} a_i$

% Force limits to the side in display mode
\[
  \sum\nolimits_{i=1}^{n} a_i
\]

% Use displaystyle in inline math
$\displaystyle \sum_{i=1}^{n} a_i$

% Force limits on an integral (above/below)
\[
  \int\limits_0^1 f(x) \, dx
\]

% Comparison of placements
\[
  \sum_{i=1}^{n}          \quad \text{(default display)}
  \qquad
  \sum\nolimits_{i=1}^{n} \quad \text{(nolimits)}
\]

% textstyle forces inline behaviour in display
\[
  \textstyle \sum_{i=1}^{n} a_i
  \quad \text{vs} \quad
  \displaystyle \sum_{i=1}^{n} a_i
\]

Use \limits sparingly in inline math because it increases the line height and can disrupt vertical spacing. When you need full-size operators inside a paragraph, prefer \displaystyle instead.

Series and Sequences

Many important formulas combine sums with limits. Here are common examples including Taylor series and Fourier series.

% Infinite series (combining sum and limit)
\[
  \sum_{n=0}^{\infty} a_n = \lim_{N \to \infty} \sum_{n=0}^{N} a_n
\]

% Taylor series expansion of e^x
\[
  e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!}
      = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots
\]

% Maclaurin series for sin(x)
\[
  \sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1}
\]

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

% Fourier coefficients
\[
  a_n = \frac{1}{L} \int_{-L}^{L} f(x) \cos\frac{n\pi x}{L} \, dx
  \qquad
  b_n = \frac{1}{L} \int_{-L}^{L} f(x) \sin\frac{n\pi x}{L} \, dx
\]

% Geometric series
\[
  \sum_{n=0}^{\infty} r^n = \frac{1}{1-r}, \quad |r| < 1
\]

Big Operators Reference

LaTeX provides a full family of "big operators" that behave like \sum with respect to limits placement. Here is a reference table:

CommandDescriptionTypical Use
\sumSummationDiscrete sums
\prodProductFinite / infinite products
\coprodCoproductCategory theory
\bigcupBig unionSet theory unions
\bigcapBig intersectionSet theory intersections
\bigoplusBig direct sumLinear algebra, module theory
\bigotimesBig tensor productTensor algebra
\bigveeBig logical ORLogic, lattice theory
\bigwedgeBig logical ANDLogic, lattice theory
\bigsqcupBig square unionDisjoint unions
\biguplusBig multiset unionMultiset operations
% Examples of big operators with bounds
\[
  \bigcup_{i=1}^{n} A_i
  \qquad
  \bigcap_{i=1}^{n} A_i
  \qquad
  \bigoplus_{k=1}^{n} V_k
  \qquad
  \bigotimes_{k=1}^{n} W_k
\]

Practical Examples

Below are complete, real-world formulas that combine integrals, sums, and limits.

Gaussian Integral

\[
  \int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
\]

Euler's Identity Derivation

% Start from the Taylor series of e^{ix}
\[
  e^{ix} = \sum_{n=0}^{\infty} \frac{(ix)^n}{n!}
         = \underbrace{\sum_{k=0}^{\infty} \frac{(-1)^k x^{2k}}{(2k)!}}_{\cos x}
         + i\underbrace{\sum_{k=0}^{\infty} \frac{(-1)^k x^{2k+1}}{(2k+1)!}}_{\sin x}
\]

% Setting x = pi gives Euler's identity
\[
  e^{i\pi} + 1 = 0
\]

Taylor Expansion of ln(1+x)

\[
  \ln(1+x) = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n
            = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots,
  \quad |x| \leq 1
\]

Riemann Sum

% Definition of the Riemann integral as a limit of sums
\[
  \int_a^b f(x) \, dx
  = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*) \, \Delta x
\]

% Where
\[
  \Delta x = \frac{b - a}{n},
  \qquad
  x_i^* \in [x_{i-1}, x_i]
\]

Laplace Transform

\[
  \mathcal{L}\{f(t)\} = \int_0^{\infty} e^{-st} f(t) \, dt
\]

Residue Theorem

\[
  \oint_C f(z) \, dz = 2\pi i \sum_{k=1}^{n} \operatorname{Res}(f, z_k)
\]

Common Mistakes

Here are frequent errors when typesetting integrals, sums, and limits in LaTeX, along with corrected versions.

% WRONG: Missing thin space before dx
$\int f(x)dx$
% CORRECT: Add \, before dx
$\int f(x) \, dx$

% WRONG: Using \limits in inline mode (disrupts line spacing)
The sum $\sum\limits_{i=1}^{n} a_i$ is too tall.
% BETTER: Let LaTeX handle inline placement naturally
The sum $\sum_{i=1}^{n} a_i$ fits the line.

% WRONG: Bare subscript on lim (no \to)
$\lim_{x a} f(x)$
% CORRECT: Use \to for the arrow
$\lim_{x \to a} f(x)$

% WRONG: Using \Sigma instead of \sum for summation
$\Sigma_{i=1}^{n}$
% CORRECT: \sum is a big operator with proper limits
$\sum_{i=1}^{n}$

% WRONG: Forgetting braces around multi-character bounds
$\int_0^10$
% CORRECT: Wrap multi-character exponents in braces
$\int_0^{10}$

% WRONG: Missing \left and \right for tall delimiters
$[\frac{x^2}{2}]_0^1$
% CORRECT: Auto-sizing delimiters
$\left[\frac{x^2}{2}\right]_0^1$

Next Steps

Free LaTeX Tools

Write LaTeX math faster with AI

Octree's AI-powered editor helps you write integrals, sums, and complex mathematical notation without memorising every command.

Try Octree Free →