Integral in LaTeX: \int

Use \int with subscript/superscript for limits, and \,dx for the differential.

Quick Answer

latex
% Definite integral:
\[ \int_0^1 x^2 \, dx = \frac{1}{3} \]

% Indefinite integral:
\[ \int x^2 \, dx = \frac{x^3}{3} + C \]

Integral Types

latex
\int f(x)\,dx          % standard integral
\iint f(x,y)\,dx\,dy    % double integral
\iiint f\,dx\,dy\,dz    % triple integral
\oint f(z)\,dz           % contour integral (closed)
\oiint                    % closed surface integral (esint package)
\idotsint                 % multiple integral with dots

Limits and Bounds

latex
% Definite bounds:
\int_a^b f(x)\,dx

% Infinity:
\int_0^\infty e^{-x}\,dx = 1

% Negative infinity to infinity:
\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}

% Region subscript:
\int_{\Omega} f\,d\Omega

Writing your thesis in LaTeX?

MonsterWriter's LaTeX Workspace gives you real-time PDF preview with no compile limits — at a fraction of Overleaf's price. Works just like Overleaf, costs 11× less.

Try MonsterWriter free

The Differential \,dx

Adding a thin space \, before dx is standard mathematical typesetting practice. It separates the integrand from the differential.

latex
% Good practice (thin space before dx):
\int f(x)\,dx

% Upright d (common in physics/engineering):
\newcommand{\dd}[1]{\mathrm{d}#1}
\int f(x)\,\dd{x}

Common Integrals

latex
\int x^n\,dx = \frac{x^{n+1}}{n+1} + C

\int e^x\,dx = e^x + C

\int \frac{1}{x}\,dx = \ln|x| + C

\int \sin x\,dx = -\cos x + C

\int \frac{1}{1+x^2}\,dx = \arctan x + C

Inline vs Display

latex
% Inline (limits beside): $\int_0^1 f\,dx$

% Display (limits below/above):
\[ \int_0^1 f(x)\,dx \]

% Force display style inline:
$\displaystyle\int_0^1 f(x)\,dx$

Related Topics