Integration

Integration is the reverse of differentiation. If f(x)=2xf'(x) = 2x, then ff could be x2x^2 — we ran the derivative backward. The same reverse operation also computes areas, total accumulated quantities, and the cumulative effect of any rate of change. This page builds up the toolkit from scratch.

The basic question

Differentiation asks: given ff, what is its rate of change ff'?

Integration asks the inverse: given a rate ff, what function has that rate as its derivative? Such a function is called an antiderivative (or primitive) of ff, written FF, with F=fF' = f.

The notation for this hunt is

f(x)dx=F(x)+C\int f(x) \, dx = F(x) + C

The integral sign \int is a stretched “S” (for summa), f(x)f(x) is the integrand, and dxdx has two roles: it marks the variable being integrated over, and also stands for an infinitesimal slice along that variable — the role made precise by the Riemann-sum picture further down (and the reason substitution lets us replace dxdx with du/g(x)du / g'(x)). The whole expression reads “the antiderivative of ff with respect to xx.”

Why the ?

Differentiation throws away constants: ddx[x2]=2x\frac{d}{dx}[x^2] = 2x, but also ddx[x2+7]=2x\frac{d}{dx}[x^2 + 7] = 2x, and ddx[x2100]=2x\frac{d}{dx}[x^2 - 100] = 2x. So when we run the derivative backward from 2x2x, we cannot recover which constant was originally there.

Every integration leaves behind a constant of integration CC: the answer is not a single function but a whole family {F+C:CR}\{F + C : C \in \mathbb{R}\}, all sharing the same derivative.

Building the rules

The power rule, by reversal

Differentiation: ddx[xn]=nxn1\frac{d}{dx}[x^n] = n x^{n-1} — the power drops by one, and the old power comes out front as a coefficient.

To reverse it, we need to raise the power by one (so it lands at nn) and divide by the new power (to cancel the coefficient that the derivative would pull out):

xndx=xn+1n+1+C(n1)\int x^n \, dx = \frac{x^{n+1}}{n+1} + C \quad (n \neq -1)
Verify by differentiatingddx ⁣[xn+1n+1]=(n+1)xnn+1=xn\frac{d}{dx}\!\left[\frac{x^{n+1}}{n+1}\right] = \frac{(n+1) x^n}{n+1} = x^n

The case n=1n = -1 fails because we would divide by zero. That case has its own answer — see the table below — and it’s the reason the natural logarithm exists.

Linearity

Two easy rules carry over from differentiation directly:

  • Constants pass through: cf(x)dx=cf(x)dx\int c \cdot f(x) \, dx = c \int f(x) \, dx.
  • Sums split apart: (f+g)dx=fdx+gdx\int (f + g) \, dx = \int f \, dx + \int g \, dx.

Together, these mean integration is linear. You can break any integral of a sum into a sum of integrals, and pull constants out front. Both follow immediately from the corresponding differentiation rules.

Putting it together

The fundamental integration rules are:

RuleFormula
Constantcdx=cx+C\int c \, dx = c x + C
Powerxndx=xn+1n+1+C    (n1)\int x^n \, dx = \frac{x^{n+1}}{n+1} + C \;\; (n \neq -1)
Constant multiplecfdx=cfdx\int c \cdot f \, dx = c \int f \, dx
Sum(f+g)dx=fdx+gdx\int (f + g) \, dx = \int f \, dx + \int g \, dx
Substitutionf(g(x))g(x)dx=F(g(x))+C,    F=f\int f(g(x)) \, g'(x) \, dx = F(g(x)) + C, \;\; F' = f

The substitution rule is more subtle than the others — we’ll build it up in its own section.

Common Integrals

Each row pairs a function ff with its antiderivative. To verify any row, differentiate the right column — you should get back the left.

f(x)f(x)f(x)dx\int f(x) \, dx
00CC
xnx^n, n1n \neq -1xn+1n+1+C\dfrac{x^{n+1}}{n+1} + C
1x\dfrac{1}{x}lnx+C\ln \lvert x \rvert + C
exe^xex+Ce^x + C
eaxe^{ax}1aeax+C\dfrac{1}{a} e^{ax} + C
lnx\ln xxlnxx+Cx \ln x - x + C
sinx\sin xcosx+C-\cos x + C
cosx\cos xsinx+C\sin x + C
1cos2x\dfrac{1}{\cos^2 x}tanx+C\tan x + C

Two oddities worth noting:

  • 1xdx=lnx+C\int \frac{1}{x} \, dx = \ln \lvert x \rvert + C uses absolute value because ln\ln is undefined for negative numbers, but 1x\frac{1}{x} has antiderivatives on both sides of zero.
  • eaxdx=1aeax+C\int e^{ax} \, dx = \frac{1}{a} e^{ax} + C — the 1a\frac{1}{a} appears because differentiating eaxe^{ax} pulls an aa out (chain rule), which we have to un-multiply by dividing.

Trigonometric Integrals

Memorize the derivatives of sine and cosine, then everything else follows by reversal:

ddxsinx=cosx    cosxdx=sinx+C\frac{d}{dx} \sin x = \cos x \implies \int \cos x \, dx = \sin x + C ddxcosx=sinx    sinxdx=cosx+C\frac{d}{dx} \cos x = -\sin x \implies \int \sin x \, dx = -\cos x + C

Be careful with the sign in the second one. The full set:

The integrals of the trigonometric functions are:

f(x)f(x)f(x)dx\int f(x) \, dx
sinx\sin xcosx+C-\cos x + C
cosx\cos xsinx+C\sin x + C
1cos2x\dfrac{1}{\cos^2 x}tanx+C\tan x + C
1sin2x\dfrac{1}{\sin^2 x}cotx+C-\cot x + C
secxtanx\sec x \tan xsecx+C\sec x + C
cscxcotx\csc x \cot xcscx+C-\csc x + C

The integrands producing inverse trigonometric antiderivatives are worth recognizing too:

11x2dx=arcsinx+C11+x2dx=arctanx+C\int \frac{1}{\sqrt{1 - x^2}} \, dx = \arcsin x + C \qquad \int \frac{1}{1 + x^2} \, dx = \arctan x + C

Substitution: reversing the chain rule

The chain rule says

ddx[F(g(x))]=F(g(x))g(x)\frac{d}{dx}[F(g(x))] = F'(g(x)) \cdot g'(x)

Read right to left, this is an integral statement:

F(g(x))g(x)dx=F(g(x))+C\int F'(g(x)) \cdot g'(x) \, dx = F(g(x)) + C

In words: if your integrand is a composite function F(g(x))F'(g(x)) multiplied by the derivative of its inner part g(x)g'(x), the antiderivative is F(g(x))F(g(x)) — no extra work required.

The mechanical technique for using this is called u-substitution (or just substitution): let u=g(x)u = g(x), compute du=g(x)dxdu = g'(x) \, dx, and rewrite the integral entirely in terms of uu:

F(g(x))g(x)dx=F(u)du=F(u)+C=F(g(x))+C\int F'(g(x)) \cdot g'(x) \, dx = \int F'(u) \, du = F(u) + C = F(g(x)) + C

The diagnostic: what to look for

Substitution is not a general technique — it works only when a specific pattern is present. Before trying it, run this two-part check:

  1. Find a composite. Does your integrand contain something of the form f(inner)f(\text{inner}), where “inner” isn’t just xx by itself? Call that inner expression g(x)g(x).
  2. Find the inner derivative. Is g(x)g'(x) (or a constant multiple of it) also present as a factor in the integrand?

If both answers are yes, set u=g(x)u = g(x) and write du=g(x)dxdu = g'(x) \, dx. The factor g(x)dxg'(x) \, dx in the integrand gets replaced by dudu, and the integral collapses into one in uu alone. If the second answer is no — the derivative is completely absent and not just off by a constant — substitution will not simplify the integral.

Why does the derivative have to be there? When you set u=g(x)u = g(x), you need to replace every piece of xx in the integrand, including the dxdx. The relation du=g(x)dxdu = g'(x) \, dx shows that dx=dug(x)dx = \frac{du}{g'(x)} — so if g(x)g'(x) doesn’t cancel with something already in the integrand, it ends up stuck in the denominator and the substitution makes things worse, not better.

For example, ex2dx\int e^{x^2} \, dx looks like a candidate with inner function g(x)=x2g(x) = x^2, but g(x)=2xg'(x) = 2x is nowhere in the integrand. Setting u=x2u = x^2 gives dx=du2xdx = \frac{du}{2x}, and the integral becomes eu2xdu\int \frac{e^u}{2x} \, du — which still contains xx, leaving the substitution stuck. This particular integral has no elementary closed form.

Fixing an off-by-constant factor

If the derivative is present but multiplied by the wrong constant, fix it by multiplying and dividing. For example, x2ex3dx\int x^2 e^{x^3} \, dx: the inner function is x3x^3 with derivative 3x23x^2, but only x2x^2 appears in the integrand — off by a factor of 3.

x2ex3dx=133x2ex3dx=13eudu=13ex3+C\int x^2 e^{x^3} \, dx = \frac{1}{3} \int 3x^2 e^{x^3} \, dx = \frac{1}{3} \int e^u \, du = \frac{1}{3} e^{x^3} + C

Constants only. This multiply-and-divide trick works only when the missing factor is a constant. Linearity lets you pull constants in and out of integrals freely — but not anything involving xx. Writing ex2dx=12x2xex2dx\int e^{x^2} \, dx = \frac{1}{2x} \int 2x \, e^{x^2} \, dx is wrong, because 12x\frac{1}{2x} is not a constant and cannot leave the integrand. If the missing factor depends on the variable of integration, substitution doesn’t apply — try a different technique.

Examples

2xcos(x2)dx\int 2x \cos(x^2) \, dx. The inner function of cos()\cos(\cdot) is x2x^2, and its derivative 2x2x sits right next to it as a factor.

Let u=x2u = x^2, so du=2xdxdu = 2x \, dx:

2xcos(x2)dx=cosudu=sinu+C=sin(x2)+C\int 2x \cos(x^2) \, dx = \int \cos u \, du = \sin u + C = \sin(x^2) + C

exdx\int e^{-x} \, dx. The inner function is x-x, whose derivative is the constant 1-1. A constant is always implicitly present.

Let u=xu = -x, so du=dxdu = -dx, meaning dx=dudx = -du:

exdx=eu(du)=eu+C=ex+C\int e^{-x} \, dx = \int e^u \cdot (-du) = -e^u + C = -e^{-x} + C

2x1+x2dx\int \frac{2x}{1 + x^2} \, dx. The denominator 1+x21 + x^2 is the inner function, and its derivative 2x2x is the numerator.

Let u=1+x2u = 1 + x^2, so du=2xdxdu = 2x \, dx:

2x1+x2dx=1udu=lnu+C=ln(1+x2)+C\int \frac{2x}{1 + x^2} \, dx = \int \frac{1}{u} \, du = \ln \lvert u \rvert + C = \ln(1 + x^2) + C

Integration by parts: reversing the product rule

The product rule says (fg)=fg+fg(fg)' = f'g + fg'. Integrating both sides:

fg=fgdx+fgdxfg = \int f'g \, dx + \int fg' \, dx

Rearranging to solve for one of the two integrals:

For differentiable functions ff and gg, integration by parts states:

f(x)g(x)dx=f(x)g(x)f(x)g(x)dx\int f(x) g'(x) \, dx = f(x) g(x) - \int f'(x) g(x) \, dx

In short form with u=f(x)u = f(x) and v=g(x)v = g(x) (so du=fdxdu = f' \, dx and dv=gdxdv = g' \, dx):

udv=uvvdu\int u \, dv = u v - \int v \, du

The idea: trade an integral you can’t do for one you can. You pick uu and dvdv from the integrand, hoping that dudu (the derivative of uu) and v=dvv = \int dv (the antiderivative of dvdv) make the resulting integral vdu\int v \, du easier than what you started with.

Rule of thumb: pick uu to be the part that gets simpler when differentiated — polynomials, lnx\ln x, arctanx\arctan x. Pick dvdv to be the part you can easily integrate — exponentials, sinx\sin x, cosx\cos x.

LIATE mnemonic. When in doubt about which factor should be uu, try them in this order — pick the first type that appears in the integrand:

LetterFunction typeExample
LLogarithmlnx\ln x
IInverse trigarctanx\arctan x, arcsinx\arcsin x
AAlgebraic (polynomials, roots)x2x^2, x\sqrt{x}
TTrigonometricsinx\sin x, cosx\cos x
EExponentialexe^x, axa^x

The order is roughly “what gets simpler fastest under differentiation” → “what stays the same or grows worse.” For xlnxdx\int x \ln x \, dx, L beats A, so u=lnxu = \ln x. For xexdx\int x e^x \, dx, A beats E, so u=xu = x. The mnemonic is a guide, not a law — when it fails, try the other split.

xexdx\int x e^x \, dx. Pick u=xu = x (so du=dxdu = dx, simpler) and dv=exdxdv = e^x \, dx (so v=exv = e^x, easy to integrate):

xexdx=xexexdx=xexex+C=(x1)ex+C\int x e^x \, dx = x e^x - \int e^x \, dx = x e^x - e^x + C = (x - 1) e^x + C

The polynomial factor xx disappeared after one differentiation — that’s the whole reason this works.

lnxdx\int \ln x \, dx — looks impossible, but the trick is to take dv=dxdv = dx and let the entire lnx\ln x be uu:

u=lnxu = \ln x (so du=1xdxdu = \frac{1}{x} \, dx), dv=dxdv = dx (so v=xv = x):

lnxdx=xlnxx1xdx=xlnx1dx=xlnxx+C\int \ln x \, dx = x \ln x - \int x \cdot \frac{1}{x} \, dx = x \ln x - \int 1 \, dx = x \ln x - x + C

If the resulting integral isn’t easier, you picked uu and dvdv the wrong way around — try swapping them.

The Definite Integral

So far we’ve computed antiderivatives — families of functions defined up to a constant. The definite integral asks for a single number: the amount accumulated by ff between two endpoints aa and bb.

Geometrically, this number is the signed area between the graph of ff and the xx-axis from x=ax = a to x=bx = b — area above the axis counted positive, area below counted negative:

abf(x)dx=(area above axis)(area below axis)\int_a^b f(x) \, dx = \text{(area above axis)} - \text{(area below axis)}

Riemann sums: where the area definition comes from

The “signed area” idea is made precise by chopping [a,b][a, b] into nn small slices of width Δx=(ba)/n\Delta x = (b-a)/n, building a rectangle of height f(xi)f(x_i^*) over each slice (for some sample point xix_i^* in the slice — see remark below for what the asterisk means), and adding up their areas:

Sn=i=1nf(xi)ΔxS_n = \sum_{i=1}^{n} f(x_i^*) \, \Delta x

This is a Riemann sum. As nn \to \infty, the rectangles shrink and the sum converges to a single number — the definite integral of ff over [a,b][a, b].

The definite integral of a function ff from aa to bb is the limit of Riemann sums as the partition is refined:

abf(x)dx=limni=1nf(xi)Δx\int_a^b f(x) \, dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*) \, \Delta x

with Δx=(ba)/n\Delta x = (b-a)/n and xix_i^* any sample point in the ii-th subinterval. The number abf(x)dx\int_a^b f(x) \, dx measures the signed area between the graph of ff and the xx-axis from x=ax = a to x=bx = b.

i=1nf(xi)Δx  n  abf(x)dx\sum_{i=1}^{n} f(x_i^*) \, \Delta x \;\xrightarrow{\,n \to \infty\,}\; \int_a^b f(x) \, dx
What the asterisk on xix_i^* means

The ii-th slice is an interval, not a single point — so to evaluate ff for the rectangle’s height, we have to pick one point from inside that interval. The asterisk is a free choice marker: it says “some point we picked from the ii-th subinterval,” without committing to which one. Common choices are the left endpoint, the right endpoint, or the midpoint — but any point in the slice is fair game. The whole reason this notation works is the theorem that as nn \to \infty, which point you pick stops mattering — every valid choice converges to the same limit. The * acknowledges the ambiguity up front, then the limit erases it.

This sum-based definition is what “area” actually means — but computing the limit directly is brutal even for simple integrands. The miracle is that we never have to: the limit equals the difference of any antiderivative at the endpoints.

Fundamental theorem of calculus (often abbreviated FTC). If ff is continuous on [a,b][a, b] and FF is any antiderivative of ff, then:

abf(x)dx=F(b)F(a)\int_a^b f(x) \, dx = F(b) - F(a)

The constant CC cancels in the difference F(b)F(a)F(b) - F(a) and does not appear.

We don’t need to add up infinitely many tiny rectangles — we just find any antiderivative and subtract. The link between the two pictures (limit of sums on one side, antiderivative on the other) is what makes calculus the toolkit it is: a question about accumulation answered by a question about rates.

0πsinxdx\int_0^\pi \sin x \, dx. An antiderivative of sinx\sin x is cosx-\cos x:

0πsinxdx=[cosx]0π=cosπ(cos0)=(1)(1)=2\int_0^\pi \sin x \, dx = [-\cos x]_0^\pi = -\cos \pi - (-\cos 0) = -(-1) - (-1) = 2

The same rules — linearity, substitution, integration by parts — all apply to definite integrals. The only extra adjustment for substitution: when you change variable from xx to u=g(x)u = g(x), the limits transform too:

abf(g(x))g(x)dx=g(a)g(b)f(u)du\int_a^b f(g(x)) \, g'(x) \, dx = \int_{g(a)}^{g(b)} f(u) \, du

After substituting you can either update the limits to g(a)g(a) and g(b)g(b) (faster) or substitute xx back in at the end before evaluating (safer when first learning).

Arc length: integrating speed

A definite integral doesn’t have to be the area under a graph. The same Riemann-sum machinery — chop a parameter interval, sum a quantity proportional to the slice width, take the limit — measures any quantity that accumulates linearly along a path. The first non-area example is arc length: the total length traced out by a parametrized curve.

Consider a curve in the plane (or in Rn\mathbb{R}^n) given by a parametrization

γ:[a,b]Rn,γ(t)=(x1(t),,xn(t))\gamma : [a, b] \to \mathbb{R}^n, \qquad \gamma(t) = (x_1(t), \dots, x_n(t))

To approximate the length of γ\gamma, partition [a,b][a, b] into nn slices, sample points t0=a<t1<<tn=bt_0 = a < t_1 < \dots < t_n = b, and add up the straight-line chord lengths between consecutive samples:

Ln=i=1nγ(ti)γ(ti1)L_n = \sum_{i=1}^{n} \|\gamma(t_i) - \gamma(t_{i-1})\|

For a smooth curve, γ(ti)γ(ti1)γ(ti1)Δt\gamma(t_i) - \gamma(t_{i-1}) \approx \gamma'(t_{i-1}) \, \Delta t over a small slice (this is the linearization from the derivative), so each chord length is approximately γ(ti1)Δt\|\gamma'(t_{i-1})\| \, \Delta t. The sum becomes a Riemann sum for γ(t)\|\gamma'(t)\|, and the limit is a definite integral.

Before writing it down, it helps to name what γ(t)\|\gamma'(t)\| actually is. Think of tt as time and γ(t)\gamma(t) as the position of a moving particle that traces out the curve as tt runs from aa to bb. Then:

  • γ(t)\gamma'(t) is the velocity vector at time tt — direction-and-rate of motion.
  • γ(t)\|\gamma'(t)\| is the speed at time tt — a single non-negative number, “how fast the particle is moving” with the direction stripped away. (This is the standard physics distinction between velocity and speed.)
  • “Speed of the parametrization” just means: how fast the parameter tt pushes the point along the curve.
What does “trace the same curve faster” actually mean?

“Faster” means changing the parameter, not scaling the components. Take the unit circle γ(t)=(cost,sint)\gamma(t) = (\cos t, \sin t) on [0,2π][0, 2\pi]. The reparametrization γ~(s)=γ(2s)=(cos2s,sin2s)\tilde\gamma(s) = \gamma(2s) = (\cos 2s, \sin 2s) on [0,π][0, \pi] traces the same circle — but ss only needs to reach π\pi for one full lap. By the chain rule γ~(s)=2γ(2s)\tilde\gamma'(s) = 2\gamma'(2s), so the speed γ~(s)=2\|\tilde\gamma'(s)\| = 2 is doubled at every point. The image (the unit circle) is unchanged.

What this is not: scaling the components, like (2cost,2sint)(2\cos t, 2\sin t). That’s a circle of radius 2 — a different curve (circumference 4π4\pi), not the same circle traced faster. Scaling components scales the curve itself; reparametrizing the variable scales the speed at which it’s traced.

With that vocabulary, the arc length integral is just the total-distance formula from physics in disguise. The infinitesimal piece γ(t)dt\|\gamma'(t)\| \, dt reads as “speed ×\times time slice = distance covered in that slice” — and integrating over [a,b][a, b] adds up all those tiny distances:

The arc length of a continuously differentiable (i.e., C1C^1) curve γ:[a,b]Rn\gamma : [a, b] \to \mathbb{R}^n is

L(γ)=abγ(t)dtL(\gamma) = \int_a^b \|\gamma'(t)\| \, dt

For a 2D curve γ(t)=(x(t),y(t))\gamma(t) = (x(t), y(t)) this expands to

L(γ)=abx(t)2+y(t)2dtL(\gamma) = \int_a^b \sqrt{x'(t)^2 + y'(t)^2} \, dt

For the graph of a function y=f(x)y = f(x) on [a,b][a, b] — a special case parametrized by γ(x)=(x,f(x))\gamma(x) = (x, f(x)) — it becomes

L=ab1+f(x)2dxL = \int_a^b \sqrt{1 + f'(x)^2} \, dx

Two points worth noticing:

  • The integrand is a scalar. Even though γ\gamma is vector-valued, γ(t)\|\gamma'(t)\| collapses to a single non-negative number at each tt — the instantaneous speed. Arc length is a 1D integral of that scalar.
  • The answer doesn’t depend on the parametrization. The same physical curve traced twice as fast still has the same length: doubling the speed of γ\gamma halves the parameter interval needed to cover it, and γ\|\gamma'\| doubles, so the integral is unchanged. Arc length is a property of the image (the trace) of γ\gamma, not of the parametrization.

Circle of radius RR. Parametrize γ(t)=(Rcost,Rsint)\gamma(t) = (R \cos t, R \sin t) for t[0,2π]t \in [0, 2\pi]:

γ(t)=(Rsint,Rcost),γ(t)=R2sin2t+R2cos2t=R\gamma'(t) = (-R \sin t, R \cos t), \qquad \|\gamma'(t)\| = \sqrt{R^2 \sin^2 t + R^2 \cos^2 t} = R

so the speed is constant, and

L=02πRdt=2πRL = \int_0^{2\pi} R \, dt = 2\pi R

— the familiar circumference, recovered from the integral.

Arc length is the simplest of a wider family of path integrals — quantities that accumulate along a curve. In every case the recipe is the same: identify what’s being accumulated per unit parameter, multiply by dtdt, and integrate. This same pattern is what generalizes to surface area as a double integral over a parametrized surface, where the analog of “speed” γ(t)\|\gamma'(t)\| becomes the magnitude of the cross product of the two tangent vectors ϕu×ϕv\|\boldsymbol{\phi}_u \times \boldsymbol{\phi}_v\| — but that’s for the curves chapter to develop.