Integration by Parts

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

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

Integrate both sides:

$$\eqalign{ \int \der {(u v)} x\,dx & = \int u \der v x\,dx + \int v \der u x\,dx \cr u v & = \int u\,dv + \int v\,du \cr \int u\,dv & = u v - \int v\,du \cr}$$

I've written "$du$ " and "$dv$ " as shorthand for "$\der u x\,dx$ " and "$\der v x\,dx$ ".

This is the integration by parts formula. The integral on the left corresponds to the integral you're trying to do. Integration by parts replaces it with a term that doesn't need integration ($u v$ ) 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 = u v - \int v\,du.$$

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

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

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

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

$$\int u\,dv = u v - \left(\der u x\right)\left(\int v\,dx\right) + \left(\dfrac{d^2 u}{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^3 u}{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^2 u}{dx^2} & & \displaystyle \int v\,dx \cr & & \searrow & \cr - & \dfrac{d^3 u}{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.

A formal proof that the table represents the algebra can be given using mathematical induction.

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^{2
   x}\,dx$ .

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

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

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

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

Therefore,

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

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

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

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

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & e^{2 x} & & x^3 \cr & & \searrow & \cr - & 2 e^{2 x} & & \dfrac{1}{4}x^4 \cr & & \searrow & \cr + & 4 e^{2 x} & & \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 more complicated, rather than less.

Here's another attempt which doesn't work:

$$\matrix{& \der {} x & & \displaystyle \int\,dx \cr & & & \cr + & 1 & & x^3 e^{2 x} \cr & & \searrow & \cr - & 0 & & \displaystyle \int x^3 e^{2 x}\,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. On the other hand, you'll see in examples to follow that sometimes putting the entire integrand into the differentiation column does work.


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 differentiation 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}$$

The acronym is "L-I-P-T-E".

For example, suppose this rule is applied to $\displaystyle \int x (\ln
   x)^2\,dx$ .

You'd try the Log function $(\ln x)^2$ in the differentiation column ahead of the Power function x.

Or consider $\displaystyle
   \int x^2 \sin 5 x\,dx$ .

Here you'd try the Power function $x^2$ in the differentiation column, because it has precedence over the Trig function $\sin 5x$ .

The last two classes of functions --- Trig functions and Exponential functions --- are essentially "tied", so if you have an integral like $\displaystyle \int e^{3 x} \sin 2 x\,dx$ , you can put either $e^{3 x}$ or $\sin 2
   x$ in the derivative column. (We'll see, however, that this kind of integral requires a trick.)


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

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

(a)

$$\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$$

(b)

$$\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.$$

(I computed $\displaystyle
   \int \ln x\,dx$ in part (a).)


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.$$

You can also do this integral using the substitution $u = x + 4$ .


Example. Compute $\displaystyle \int
   \dfrac{x^2}{(1 - x)^3}\,dx$ .

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

$$\int \dfrac{x^2}{(1 - x)^3}\,dx = \dfrac{1}{2} \dfrac{x^2}{(1 - x)^2} - \dfrac{x}{1 - x} - \ln |1 - x| + C.$$

You could also do this integral using the substitution $u = 1 - x$ .


Parts can also be useful when the integrand is a single, unsimplifiable chunk. I already gave an example of this earlier when I computed $\displaystyle
   \int \ln x\,dx$ . In the next example, you can't do the integral of $\sin^{-1} x$ as-is, and there's no algebra you can do to change the integrand.

Example. Compute $\displaystyle \int \sin^{-1}
   x\,dx$ .

The idea is to use parts, putting $\sin^{-1} x$ in the derivative column so it goes away when it's differentiated. The derivative is an algebraic expression which "fits better" with the x you get in the integration column.

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

Therefore,

$$\int \sin^{-1} x\,dx = x \sin^{-1} x - \int \dfrac{x}{\sqrt{1 - x^2}}\,dx.$$

I can do the new integral by substitution: Let $u = 1 - x^2$ , so $du = -2 x\,dx$ , and $dx = \dfrac{du}{-2 x}$ :

$$x \sin^{-1} x - \int \dfrac{x}{\sqrt{1 - x^2}}\,dx = x \sin^{-1} x - \int \dfrac{x}{\sqrt{u}}\cdot \dfrac{du}{-2 x} = x \sin^{-1} x + \dfrac{1}{2} \int \dfrac{du}{\sqrt{u}} = x \sin^{-1} x + \dfrac{1}{2} \cdot 2 \sqrt{u} + C =$$

$$x \sin^{-1} x + \sqrt{1 - x^2} + 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$$


I noted earlier that a product of an exponential and a trig function would require a trick. The next example illustrates this.

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

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

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

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

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}).$$

Move the copy of the original integral on the right back to the left and solve for it:

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

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

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

Note: You can also do integrals like $\displaystyle \int \sin 5 x
   \cos 3 x\,dx$ using this approach, though this integral could also be done using a trig identity.


Contact information

Bruce Ikenaga's Home Page

Copyright 2019 by Bruce Ikenaga