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 {(u v)} x\,dx = \int u \der v x\,dx + \int v \der u x\,dx,$$

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

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

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. Parts replaces it with a term that doesn't need integration ($u v$ ) and another integral ($\int v\,du$ ). You hope that 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^2u}{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^2u}{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^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.

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

$$\hbox{L-I-P-T-E}$$

For example, suppose this rule is applied to

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

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

Or consider

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

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


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

Parts is also useful when the integrand is a single, unsimplifiable chunk. In this case, there isn't an obvious way to change or simplify $\sin^{-1} x$ . Integration by parts replaces one integral with another, so I try it here and hope I get something that is easier to integrate:

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


In some cases, integration by parts produces a copy of the original integral. Depending on how it arises, this may not be a bad thing.

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!

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:

$$\eqalign{ \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 \cr \dfrac{5}{4}\int e^x \sin 2x\,dx & = -\dfrac{1}{2}e^x \cos 2x + \dfrac{1}{4} e^x \sin 2x \cr \int e^x \sin 2x\,dx & = -\dfrac{2}{5}e^x \cos 2x + \dfrac{1}{5} e^x \sin 2x + C \cr} \quad\halmos$$


Example. Compute $\displaystyle \int (\csc
   x)^3\,dx$ .

$$\int (\csc x)^3\,dx = \int (\csc x)^2 (\csc x)\,dx = \int [1 + (\cot x)^2] (\csc x)\,dx = \int \csc x\,dx + \int (\cot x)^2 \csc x\,dx =$$

$$\matrix{ & \displaystyle \der {} x & \displaystyle \int\,dx \cr \noalign{\vskip2pt} + & \cot x & \csc x \cot x \cr \noalign{\vskip2pt} - & -(\csc x)^2 & -\csc x \cr}$$

$$\int \csc x\,dx - csc x \cot x - \int (\csc x)^3\,dx = -\ln |\csc x + \cot x| - \csc x \cot x - \int (\csc x)^3\,dx.$$

There is a copy of the original integral on the right side. Thus,

$$\eqalign{ \int (\csc x)^3\,dx & = -\csc x \cot x - \ln |\csc x + \cot x| - \int (\csc x)^3\,dx \cr 2 \int (\csc x)^3\,dx & = -\csc x \cot x - \ln |\csc x + \cot x| \cr \noalign{\vskip2pt} \int (\csc x)^3\,dx & = -\dfrac{1}{2} \csc x \cot x - \dfrac{1}{2} \ln |\csc x + \cot x| + c \quad\halmos \cr}$$


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


Contact information

Bruce Ikenaga's Home Page

Copyright 2017 by Bruce Ikenaga