Integration by Parts

If u and v are functions of x, the Product Rule says that

$$\der {(uv)} x = u \der v x + v \der u x.$$

Integrate both sides:

$$\int \der {(uv)} x\,dx = \int u \der v x\,dx + \int v \der u x\,dx,$$

$$uv = \int u\,dv + \int v\,du,$$

$$\int u\,dv = uv - \int v\,du.$$

This is the integration by parts formula. The integral on the left corresponds to the integral you're trying to do. Parts replaces it with some junk ($uv$ ) and another integral ($\int v\,du$ ). You'll make progress if the new integral is easier to do than the old one.

I'm going to set up parts computations using tables; it is much easier to do repeated parts computations this way than to use the standard u-$dv-v-du$ approach. To see where the table comes from, start with the parts equation:

$$\int u\,dv = uv - \int v\,du.$$

Apply parts to the integral on the right, differentiating $\der u x$ and integrating v. This gives

$$\int u\,dv = uv - \left[\left(\der u x\right)\left(\int v\,dx\right) - \int \left(\int v\,dx\right) \left(\dfrac{d^2u}{dx^2}\right)\,dx\right] = uv - \left(\der u x\right)\left(\int v\,dx\right) + \int \left(\int v\,dx\right)\left(\dfrac{d^2u}{dx^2}\right)\,dx.$$

If I apply parts yet again to the new integral on the right, I would get

$$\int u\,dv = uv - \left(\der u x\right)\left(\int v\,dx\right) + \left(\dfrac{d^2u}{dx^2}\right) \left(\int \left(\int v\,dx\right)\,dx\right) - \int \left(\int \left(\int v\,dx\right)\,dx\right) \left(\dfrac{d^3u}{dx^3}\right)\,dx.$$

There's a pattern here, and it's captured by the following table:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr + & u & & dv \cr & & \searrow & \cr - & \der u x & & v \cr & & \searrow & \cr + & \dfrac{d^2u}{dx^2} & & \displaystyle \int v\,dx \cr & & \searrow & \cr - & \dfrac{d^3u}{dx^3} & & \displaystyle \int \left(\int v\,dx\right)\,dx \cr \vdots & \vdots & & \vdots \cr}$$

To make the table, put alternating +'s and -'s in the left-hand column. Take the original integral and break it into a u (second column) and a $dv$ (third column). (I'll discuss how you choose u and $dv$ later.) Differentiate repeatedly down the u-column, and integrate repeatedly down the $dv$ -column. (You don't write down the $dx$ ; it's kind of implicitly there in the third column, since you're integrating.)

How do you get from the table to the messy equation above? Consider the first term on the right: $uv$ . You get that from the table by taking the + sign, taking the u next to it, and then moving "southeast" to grab the v.

If you compare the table with the equation, you'll see that you get the rest of the terms on the right side by multiplying terms in the table according to the same pattern:

$$\matrix{(+ \quad\hbox{or}\quad -) & \rightarrow & (\hbox{junk}) & & \cr & & & \searrow & \cr & & & & (\hbox{stuff}) \cr}$$

The table continues downward indefinitely, so how do you stop? If you look at the last messy equation above and compare it to the table, you can see how to stop: Just integrate all the terms the last row of the table.

You'll see that in many examples, the process will stop naturally when the derivative column entries become 0.


Example. Compute $\displaystyle \int x^3 e^{2x}\,dx$ .

Parts is often useful when you have different kinds of functions in the same integral. Here I have a power ($x^3$ ) and and exponential ($e^{2x}$ ), and this suggests using parts.

I have to "allocate" $x^3
   e^{2x}\,dx$ between u and $dv$ --- remember that $dx$ implicitly goes into $dv$ . I will use $u = x^3$ and $dv = e^{2x}\,dx$ . Here's the parts table:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & x^3 & & e^{2x} \cr & & \searrow & \cr - & 3x^2 & & \dfrac{1}{2}e^{2x} \cr & & \searrow & \cr + & 6x & & \dfrac{1}{4}e^{2x} \cr & & \searrow & \cr - & 6 & & \dfrac{1}{8}e^{2x} \cr & & \searrow & \cr + & 0 & \to & \dfrac{1}{16}e^{2x} \cr}$$

You can see the derivatives of $x^3$ in one column and the integrals of $e^{2x}$ in another. Notice that when I get a 0, I cut off the computation.

Therefore,

$$\int x^3 e^{2x}\,dx = \dfrac{1}{2}x^3e^{2x} - \dfrac{3}{4}x^2e^{2x} + \dfrac{6}{8}xe^{2x} - \dfrac{6}{16}e^{2x} + \int 0\,dx.$$

But $\displaystyle \int 0\,dx$ is just 0 (up to an arbitrary constant), so I can write

$$\int x^3 e^{2x}\,dx = \dfrac{1}{2}x^3e^{2x} - \dfrac{3}{4}x^2e^{2x} + \dfrac{6}{8}xe^{2x} - \dfrac{6}{16}e^{2x} + C.$$

Before leaving this problem, it's worth thinking about why the $x^3$ went into the derivative column and the $e^{2x}$ went into the integral column. Here's what would happen if the two were reversed:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & e^{2x} & & x^3 \cr & & \searrow & \cr - & 2e^{2x} & & \dfrac{1}{4}x^4 \cr & & \searrow & \cr + & 4e^{2x} & & \dfrac{1}{20}x^5 \cr \vdots & \vdots & & \vdots \cr}$$

This is bad for two reasons. First, I'm not getting that nice 0 I got by repeatedly differentiating $x^3$ . Worse, the powers in the last column are getting bigger! This means that the problem is getting {\it more} complicated, rather than less.

Here's another attempt which doesn't work:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & 1 & & x^3e^{2x} \cr & & \searrow & \cr - & 0 & & \displaystyle \int x^3e^{2x}\,dx \cr}$$

I got a 0 this time, but how can I find the integral in the second row? --- it's the same as the original integral! Putting the entire integrand into the integration column never works.


Here's a rule of thumb which reflects the preceding discussion. When you're trying to decide which part of an integral to put into the derivative column, the order of preference is roughly

$$\hbox{{\bf L}ogs \quad {\bf I}nverse trigs \quad {\bf P}owers \quad {\bf T}rig \quad {\bf E}xponentials}$$

L-I-P-T-E.

According to this rule, in

$$\int x (\ln x)^2\,dx,$$

you'd try the log $(\ln x)^2$ in the derivative column ahead of the power x.

And in

$$\int e^{2x}\sin 5x\,dx,$$

you'd try the trig function $\sin 5x$ in the derivative column, because it has precedence over the exponential $e^{2x}$ .


Example. Compute $\displaystyle \int \ln x\,dx$ .

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & \ln x & & 1 \cr & & \searrow & \cr - & \dfrac{1}{x} & \rightarrow & x \cr}$$

$$\int \ln x\,dx = x\ln x - \int\,dx = x\ln x - x + C.\quad\halmos$$


Example. Compute $\displaystyle \int (\ln x)^2\,dx$ .

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & (\ln x)^2 & & 1 \cr & & \searrow & \cr - & \dfrac{2\ln x}{x} & \rightarrow & x \cr}$$

$$\int (\ln x)^2\,dx = x(\ln x)^2 - 2\int \ln x\,dx = x(\ln x)^2 - 2(x \ln x - x) + C.\quad\halmos$$


Example. Compute $\displaystyle \int x(x + 4)^{50}\,dx$ .

First,

$$\int (x + 4)^{50}\,dx = \int u^{50}\,du = \dfrac{1}{51}u^{51} + C = \dfrac{1}{51}(x + 4)^{51} + C.$$

$$\left[u = x + 4, \quad du = dx\right]$$

The same substitution shows that

$$\int (x + 4)^{51}\,dx = \dfrac{1}{52}(x + 4)^{52} + C.$$

Now do the original integral by parts:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & x & & (x + 4)^{50} \cr & & \searrow & \cr - & 1 & & \dfrac{1}{51}(x + 4)^{51} \cr & & \searrow & \cr + & 0 & & \dfrac{1}{2652}(x + 4)^{52} \cr}$$

$$\int x(x + 4)^{50}\,dx = \dfrac{1}{51}x(x + 4)^{51} - \dfrac{1}{2652}(x + 4)^{52} + C.\quad\halmos$$


Example. Compute $\displaystyle \int \arctan x\,dx$ .

Parts is also useful when the integrand is a single, unsimplifiable lump. You can't do anything interesting with $\arctan x$ , so use parts.

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & \arctan x & & 1 \cr & & \searrow & \cr - & \dfrac{1}{x^2 + 1} & \to & x \cr}$$

Therefore,

$$\int \arctan x\,dx = x \arctan x - \int \dfrac{x}{x^2 + 1}\,dx.$$

I can do the new integral by substituting $u = x^2 + 1$ . Then $du = 2x\,dx$ , so $dx =
   \dfrac{du}{2x}$ :

$$x \arctan x - \int \dfrac{x}{x^2 + 1}\,dx = x \arctan x - \int \dfrac{x}{u}\cdot \dfrac{du}{2x} = x \arctan x - \dfrac{1}{2} \int \dfrac{du}{u} = x \arctan x - \dfrac{1}{2} \ln |u| + C =$$

$$x \arctan x - \dfrac{1}{2} \ln |x^2 + 1| + C.\quad\halmos$$


Example. Compute $\displaystyle \int_0^{\pi/2} x \sin x \,dx$ .

If you do a definite integral using parts, compute the antiderivative using parts as usual, then slap on the limits of integration at the end.

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & x & & \sin x\cr & & \searrow & \cr - & 1 & & -\cos x\cr & & \searrow & \cr + & 0 & & -\sin x\cr}$$

Thus,

$$\int_0^{\pi/2} x \sin x \,dx = \left[-x \cos x + \sin x\right]_0^{\pi/2} = 1.\quad\halmos$$


Example. Compute $\displaystyle \int e^x \sin 2x\,dx$ .

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & e^x & & \sin 2x \cr & & \searrow & \cr - & e^x & & -\dfrac{1}{2}\cos 2x \cr & & \searrow & \cr + & e^x & & -\dfrac{1}{4}\sin 2x \cr}$$

$$\int e^x \sin 2x\,dx = -\dfrac{1}{2}e^x \cos 2x + \dfrac{1}{4} e^x \sin 2x - \dfrac{1}{4} \int e^x \sin 2x\,dx.$$

What's this? All that work and you get the original integral again!

Actually, you're almost done. Jog your brain and get out of "parts mode". Instead, look at the equation as an equation to be solved for the original integral. It looks like this:

$$\hbox{original integral} = \hbox{some junk} - \hbox{original integral}.$$

Just move the copy of the original integral on the right back to the left!

$$\int e^x \sin 2x\,dx = -\dfrac{1}{2}e^x \cos 2x + \dfrac{1}{4} e^x \sin 2x - \dfrac{1}{4}\int e^x \sin 2x\,dx,$$

$$\dfrac{5}{4}\int e^x \sin 2x\,dx = -\dfrac{1}{2}e^x \cos 2x + \dfrac{1}{4} e^x \sin 2x,$$

$$\int e^x \sin 2x\,dx = -\dfrac{2}{5}e^x \cos 2x + \dfrac{1}{5} e^x \sin 2x + C.\quad\halmos$$


Send comments about this page to: bikenaga@marauder.millersville.edu.

Last updated: January 22, 2006

Bruce Ikenaga's Home Page

Math Department Home Page

Millersville University Home Page

Copyright 2005 by Bruce Ikenaga