FormaTeX

\int_{a}^{b}

Integrals in LaTeX — Complete Syntax Guide

Everything you need to typeset integrals in LaTeX — from a simple \int to multi-dimensional and contour integrals with \iint, \iiint, and \oint. Includes limit placement, spacing conventions, and copy-ready examples.

\int{basic syntax}

Basic integral syntax

The \int command is available in LaTeX's core math mode, but loading amsmath is strongly recommended — it corrects spacing, adds multi-integral commands, and provides the \, thin space typically written before dx.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

% Indefinite integral
\[ \int f(x)\,dx \]

% Definite integral
\[ \int_{a}^{b} f(x)\,dx \]

% Definite integral evaluated
\[ \int_{0}^{1} x^{2}\,dx = \frac{x^{3}}{3}\bigg|_{0}^{1} = \frac{1}{3} \]

% Common antiderivatives
\[ \int \frac{1}{1+x^{2}}\,dx = \arctan(x) + C \]
\[ \int e^{x}\,dx = e^{x} + C \]
\[ \int \frac{1}{x}\,dx = \ln|x| + C \]

\end{document}
\int f(x)\,dxIndefinite integral

No limits specified. The result is a family of antiderivatives differing by a constant C.

\int_{a}^{b} f(x)\,dxDefinite integral

Lower limit a and upper limit b are placed below and above the integral sign respectively.

\int_{-\infty}^{+\infty}Improper integral

Use \infty from amsmath for infinite bounds. LaTeX renders the infinity symbol automatically.

\int \!\! \intThin-space adjustment

Use \, before dx for a thin space (standard typographic convention in display math).

\section{Definite vs Indefinite}

Definite vs indefinite integrals

The only syntactic difference is whether you supply the lower _{a} and upper ^{b} limits. LaTeX places them below and above the integral symbol in display mode.

Indefinite

\int f(x)\,dx

No bounds. Returns a function plus an arbitrary constant C. Used when finding antiderivatives.

Definite

\int_{a}^{b} f(x)\,dx

Evaluated between a and b. Returns a numerical value equal to the signed area under the curve.

Improper (infinite bounds)

\int_{0}^{\infty} f(x)\,dx

One or both bounds are ±∞. Use \infty from amsmath. Convergence must be checked separately.

Evaluation bar

\bigg|_{0}^{1}

Typeset the evaluation bar after an antiderivative with \bigg| and the limits as a subscript/superscript pair.

\iint{multiple integration}

Multiple integration

The amsmath package provides \iint (double) and \iiint (triple) with correctly spaced integral signs. For closed surface integrals, add the esint package which supplies \oiint and \oiiint.

\documentclass{article}
\usepackage{amsmath}
\usepackage{esint} % oiint, oiiint

\begin{document}

% Double integral over domain D
\[ \iint_{D} f(x,y)\,dx\,dy \]

% Triple integral over volume V
\[ \iiint_{V} \rho(x,y,z)\,dx\,dy\,dz \]

% Line integral (closed path)
\[ \oint_{C} \mathbf{F} \cdot d\mathbf{r} \]

% Closed surface integral (requires esint)
\[ \oiint_{S} \mathbf{F} \cdot d\mathbf{S} \]

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

% Physics: Boltzmann partition function
\[ Z = \int_{-\infty}^{\infty} e^{-\beta H(q,p)}\,dq\,dp \]

\end{document}

\oint{contour integrals}

Contour integrals

Closed-path integrals use a circle overlaid on the integral sign to indicate integration around a closed curve or surface. All contour integral commands accept the same subscript and superscript syntax as \int.

\ointamsmath

Line integral along a closed curve. Core amsmath command — no extra package needed.

\oiintesint

Closed surface integral (double). Requires \usepackage{esint}. Used in Gauss's law.

\oiiintesint

Closed volume integral (triple). Requires esint. Used for 3D divergence theorem applications.

\ointclockwiseesint

Explicitly clockwise contour integral. Useful in complex analysis to specify orientation.

\ointctrclockwiseesint

Counter-clockwise contour integral. The positive (standard) orientation in complex analysis.

\varointclockwiseesint

Variant clockwise contour. Alternate glyph provided by esint for style preference.

\limits{placement reference}

Limits and bounds placement

LaTeX automatically chooses limit placement based on context: above/below in display mode, to the side in inline mode. You can override this with \limits and \nolimits.

SyntaxPlacement
\int_{a}^{b}Subscript a below, superscript b above
\int\limits_{a}^{b}Forces limits above/below even in inline mode
\int\nolimits_{a}^{b}Forces limits to the side (inline style) even in display mode
\displaystyle\int_{a}^{b}Display-size integral with limits in paragraph text

\section{Physics integrals}

Physics integrals

Physics equations frequently involve complex integral expressions. Here are three canonical examples with their full LaTeX syntax.

Maxwell's Equations (Integral form)

\oint_{S} \mathbf{E} \cdot d\mathbf{S} = \frac{Q_{\text{enc}}}{\varepsilon_0}

Gauss's law for electric flux through a closed surface. Requires \oiint from esint for a double closed surface integral.

Boltzmann Partition Function

Z = \int_{-\infty}^{\infty} e^{-\beta H(q,p)}\,dq\,dp

Statistical mechanics partition function integrated over all phase-space coordinates q and p.

Fourier Transform

\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\,e^{-2\pi i x \xi}\,dx

Transforms a time-domain signal into the frequency domain. The exponential kernel uses inline math mode for the exponent.

FormaTeX Playground

Classic Integrals — live compilation

The playground is pre-loaded with Gaussian, Dirichlet, Fresnel, and Gauss' theorem examples. Compile instantly with pdfLaTeX.

\section{FAQ}

Frequently asked questions

FormaTeX

Ready to compile your integrals?

Browser-based LaTeX editor with pdfLaTeX, XeLaTeX, and LuaLaTeX. Free tier included — no credit card required.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy