Integration by parts

We can use integration by parts when we are required to integrate a product. The Edexcel formula booklet gives the formula for integration by parts:

\int \left(u\frac{dv}{dx}\right)dx=uv-\int v\frac{du}{dx}dx

When we integrate a product we choose one of the functions to be u and the other function to be \frac{dv}{dx}. We then find \frac{du}{dx} and v and plug them into the formula above. It might seem like we’ve complicated things as there are two terms on the right, but the idea is to choose u and \frac{dv}{dx} so as to make the integral on the right a more simple one to find. For example, consider \int x\cos(x)dx. We choose u=x and \frac{dv}{dx}=\cos(x) as this will simplify the integral on the right hand side in the formula. It follows that \frac{du}{dx}=1 and v=\sin(x) (we leave the integration constant until the end) and so:

\int x\cos(x)\,dx=x\sin(x)-\int \sin(x)\times 1 \,dx =x\sin(x)+\cos(x)+c

If the integral is a definite one we can include the limits as follows:

\int_a^b \left(u\frac{dv}{dx}\right)dx=\left[uv\right]_a^b-\int_a^b v\frac{du}{dx}dx

See Example 1. One application of integration by parts may not be enough in some examples. Even though an integral might be simplified from one application, it may take another to complete the integration – see Example 2. In some of these cases, especially trigonometric products, it may seem that you end up with the same integral again. However, it is still possible to deduce the integral from this – see Example 3. Note that in this example, it doesn’t matter which way round we choose u and \frac{dv}{dx} initially.

Derivation of the Formula

The formula above comes from the product rule for differentiation. Recall that the product rule for differentiation:

\frac{d}{dx}\left(uv\right)=u\frac{dv}{dx}+v\frac{du}{dx}

where u and v are both functions of x. It follows that 

uv=\int \left(u\frac{dv}{dx}+v\frac{du}{dx}\right)dx=\int u\frac{dv}{dx}dx+\int v\frac{du}{dx}dx

We can rearrange this to get:

\int \left(u\frac{dv}{dx}\right)dx=uv-\int v\frac{du}{dx}dx

The trick for integrating ln(x)

Although we know that \ln(x) differentiates to \frac{1}{x}, we don’t yet know how to integrate \ln(x). There is a trick to this one – memorise it! Treat. \ln(x) as a product of one and itself. That is, write it as \ln(x)=\ln(x)\times 1. We recognise this as a product and we can use integration by parts to integrate it. Let u=\ln(x) and \frac{dv}{dx}=1. It follows that \frac{du}{dx}=\frac{1}{x} and v=x. Hence,

\begin{array}{lll}\int \ln(x)dx&=&\int \ln(x)\times 1\,dx\hspace{5pt}=\hspace{5pt}x\ln(x)-\int x\times\frac{1}{x}dx\hspace{5pt}=\hspace{5pt}x\ln(x)-\int 1\,dx\\&=&x\ln(x)-x+c\end{array}

Choosing u and \frac{dv}{dx} around the other way round would not work as choosing \frac{dv}{dx}=\ln(x) would require integrating \ln(x) – this is what we are trying to do anyway. We can check this by differentiating using the product rule where necessary:

\frac{d}{dx}\left(x\ln(x)-x+c\right)=1\times\ln(x)+x\times\frac{1}{x}+1=\ln(x).

When integrating other products that include \ln(x) it is usually best to choose u=\ln(x) as choosing it as \frac{dv}{dx} will require integrating \ln(x) and will complicate the integral. See Example 1.

Examples

Evaluate \int^3_1 x\ln(x) dx.

Solution:

In this example, we choose u=\ln(x) (since integrating \ln(x) will be more complicated) and \frac{dv}{dx}=x. It follows that \frac{du}{dx}=\frac{1}{x} and v=\frac{1}{2}x^2. Hence,

\begin{array}{lll}\int_1^3x\ln(x)dx&=&\left[\ln(x)\times\frac{1}{2}x^2\right]_1^3-\int_1^3\frac{1}{2}x^2\times\frac{1}{x}dx\\&=&\left[\frac{1}{2}x^2\ln(x)\right]_1^3-\int_1^3\frac{1}{2}x,dx\\&=&\frac{1}{2}(3)^2-\frac{1}{2}(1)^2-\left[\frac{1}{4}x^2\right]_1^3\\&=&\frac{9}{2}-\frac{1}{2}-\frac{9}{4}+\frac{1}{4}\\&=&2\end{array}

Find \int x^2 e^{3x}dx.

Solution:

Since the integrand is a product and there is an x^2 term, this will require integration by parts twice. Choose u=x^2 and \frac{dv}{dx}=e^{3x} and so \frac{du}{dx}=2x and v=\frac{1}{3}e^{3x}. It follows that 

\int x^2e^{3x}dx=x^2\times \frac{1}{3}e^{3x}-\int\frac{1}{3}e^{3x}\times 2x\,dx=\frac{1}{3}x^2e^{3x}-\frac{2}{3}\int xe^{3x}dx.

The final integral here is simpler but we still require another application of integration by parts. This time choose u=x and \frac{dv}{dx}=e^{3x} and so \frac{du}{dx}=1 and v=\frac{1}{3}e^{3x}. It follows that 

\int xe^{3x}dx=x\times\frac{1}{3}e^{3x}-\int \frac{1}{3}e^{3x}\times 1\,dx=\frac{1}{3}xe^{3x}-\frac{1}{9}e^{3x}+\hat{c}.

(see below as to why we use \hat{c} here for the integration constant). Substituting into the first integral we have:

\int x^2e^{3x}d=\frac{1}{3}x^2e^{3x}-\frac{2}{3}\left(\frac{1}{3}xe^{3x}-\frac{1}{9}e^{3x}+\hat{c}\right)=\frac{1}{3}x^2e^{3x}-\frac{2}{9}xe^{3x}+\frac{2}{27}e^{3x}+c

Note that -\frac{2}{3}\hat{c} is just an arbitrary constant if \hat{c} is an arbitrary constant – we can simply call it c.

Use integration by parts to find \int\sin(3x)\cos(2x)dx.

Solution:

We let I=\int\sin(3x)\cos(2x), we will see why below. Here we shall choose u=\sin(3x) and \frac{dv}{dx}=\cos(2x). Hence, \frac{du}{dx}=3\cos(3x) and v=\frac{1}{2}\sin(2x) and so

\begin{array}{lll}I&=&\sin(3x)\times\frac{1}{2}\sin(2x)-\int \frac{1}{2}\sin(2x)\times 3\cos(3x)dx\\&=&\frac{1}{2}\sin(3x)\sin(2x)-\frac{3}{2}\int\sin(2x)\cos(3x)dx\end{array}

Applying integration by parts again with u=\cos(3x) and \frac{dv}{dx}=\sin(2x) so that \frac{du}{dx}=-3\sin(3x) and v=-\frac{1}{2}\cos(2x) we have

\begin{array}{lll}\int\sin(2x)\cos(3x)dx&=&\cos(3x)\times-\frac{1}{2}\cos(2x)-\int-\frac{1}{2}\cos(2x)\times- 3\sin(3x)dx\\&=&-\frac{1}{2}\cos(3x)\cos(2x)-\frac{3}{2}\int\sin(3x)\cos(2x)dx+\hat{c}\\&=&-\frac{1}{2}\cos(3x)\cos(2x)-\frac{3}{2}I+\hat{c}\end{array}

Substituting back into the above we have:

\begin{array}{lll}I&=&\frac{1}{2}\sin(3x)\sin(2x)-\frac{3}{2}\left(-\frac{1}{2}\cos(3x)\cos(2x)-\frac{3}{2}I+\hat{c}\right)\\&=&\frac{1}{2}\sin(3x)\sin(2x)+\frac{3}{4}\cos(3x)\cos(2x)+\frac{9}{4}I+c\end{array}

Hence, 

\begin{array}{lll}-\frac{5}{4}I&=&-\frac{1}{2}\sin(3x)\sin(2x)-\frac{3}{4}\cos(3x)\cos(2x)+c\\\Rightarrow I&=&-\frac{2}{5}\sin(3x)\sin(2x)-\frac{3}{5}\cos(3x)\cos(2x)+c\\&=&\frac{1}{5}\left(\cos(5x)-\cos(x)\right)-\frac{3}{10}\left(\cos(5x)+\cos(x)\right)\\&=&-\frac{1}{10}\cos(5x)-\frac{1}{2}\cos(x)+c\end{array}

where we have used the trigonometric identities in the formula booklet. This shows that the solution is the same as that obtained on Integrating with Trigonometric Identities page. The solution using integration by parts seen here is much longer and so using identities in the beginning is preferable.

If you prefer to use integration by parts anyway note that the choice of u and \frac{dv}{dx} doesn’t matter in the first application of integration by parts. However, for the second they must be chosen the opposite way round. This method will fail if you don’t.