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 dotsLimits 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\OmegaThe 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 + CInline 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$