All guides

Integral in LaTeX

Updated:

An integral is written with \int, and its limits like indices: the lower one with _ and the upper one with ^. Add a small space \, before dx so the differential does not run into the integrand.

Definite integral

\int_0^1 x^2 \, dx = \frac{1}{3}
∫01x2 dx=13\int_0^1 x^2 \, dx = \frac{1}{3}

The thin space \, separates the integrand from dx. If your course follows ISO and sets the differential upright, write \mathrm{d}x instead.

Copying this from handwritten notes? Snap a photo of the page and CamteX turns the formulas into LaTeX. Try it free

Indefinite integral

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

An indefinite integral has no limits, and the constant of integration C closes the result. The absolute value inside the logarithm keeps it valid for negative x.

Evaluating the antiderivative

\int_0^{\pi} \sin x \, dx = \Big[ -\cos x \Big]_0^{\pi} = 2
∫0πsin⁡x dx=[−cos⁡x]0π=2\int_0^{\pi} \sin x \, dx = \Big[ -\cos x \Big]_0^{\pi} = 2

The bracket with limits shows the substitution step. \Big makes it a little taller than plain brackets so the limits on it stay readable.

Double integral

\iint_D f(x, y) \, dx \, dy
∬Df(x,y) dx dy\iint_D f(x, y) \, dx \, dy

\iint and \iiint draw several signs with the correct spacing; two separate \int would sit too far apart. The region of integration goes in the subscript.

Closed contour integral

\oint_C \vec{E} \cdot d\vec{l}
∮CE⃗⋅dl⃗\oint_C \vec{E} \cdot d\vec{l}

\oint is the integral around a closed curve, the form used in Gauss's and Ampère's laws. The vector arrows and \cdot come from the dot product inside.

Limits above and below the sign

\int\limits_{a}^{b} f(x) \, dx
∫abf(x) dx\int\limits_{a}^{b} f(x) \, dx

By default the limits sit to the right of the integral sign. \limits moves them above and below, which some textbooks prefer for long limits.

Common mistakes

See also

Don't want to memorize commands?

Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.

Try it free