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}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| + CAn 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} = 2The 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\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}\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) \, dxBy 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
- No space before dx: f(x)dx looks like the product f(x)·d·x.
- A multi-character limit without braces: \int_0^2\pi only takes the 2. Correct: \int_0^{2\pi}.
- \int\int instead of \iint: the two signs end up too far apart.
See also
Don't want to memorize commands?
Draw a formula or paste a screenshot, and CamteX turns it into ready LaTeX.