Integration by parts

Integration by parts is the product rule used backwards1. We check it with xexdx\int xe^{-x}\,dx.

The formula

fgdx=fgfgdx\int f g'\,dx = fg - \int f' g\,dx

It comes from integrating both sides of the product rule (fg)=fg+fg(fg)' = f'g + fg' and rearranging. One chooses ff and gg' so that the integral left on the right is simpler than the original.

Working it out

Taking f=xf = x and g=exg' = e^{-x} gives f=1f' = 1 and g=exg = -e^{-x}, so the result is as follows.

xexdx=xex+exdx=(x+1)ex+C\int xe^{-x}\,dx = -xe^{-x} + \int e^{-x}\,dx = -(x + 1)e^{-x} + C

Differentiating to check gives ex+(x+1)ex=xex-e^{-x} + (x + 1)e^{-x} = xe^{-x}, returning the original.

Making the choice

ChoiceIntegral left overOutcome
f=xf = x, g=exg' = e^{-x}exdx\int e^{-x}dxsimpler
f=exf = e^{-x}, g=xg' = xx22exdx\int \dfrac{x^2}{2}e^{-x}dxthe degree goes up

The knack is to put the factor that gets simpler under differentiation into ff.

It works over an infinite interval

Since (x+1)ex0-(x + 1)e^{-x} \to 0 as xx \to \infty, the following holds.

0xexdx=0(1)=1\int_0^{\infty} xe^{-x}\,dx = 0 - (-1) = 1

That says the mean of the exponential distribution is 11.

Reading in a factor of 11

For logxdx\int \log x\,dx, taking f=logxf = \log x and g=1g' = 1 gives xlogx1dx=xlogxxx\log x - \int 1\,dx = x\log x - x. Even when nothing looks like a product, reading in a factor of 11 lets integration by parts apply.

The type that comes back after two rounds

In exsinxdx\int e^x \sin x\,dx, two rounds of integration by parts bring the original integral back on the right. Solving the result as an equation gives the following.

exsinxdx=ex(sinxcosx)2+C\int e^x \sin x\,dx = \frac{e^x(\sin x - \cos x)}{2} + C

It looks like going in circles, yet it is a rare type that solves itself.

The humped curve on the graph is y=xexy = xe^{-x}, the curve rising from below toward 00 is the antiderivative y=(x+1)exy = -(x + 1)e^{-x}, and the large dots are the local maximum and (0,1)(0, -1).

  1. Integration by parts, Wikipedia