# Integration by Parts

## Overview

If you read the page "Integration by Substitution" you will know that it describes a technique called u-substitution. This is a technique we can use if we have an integral that is the product of two functions and that takes the following form:

 ∫ ƒ(g(x)) g′(x) dx

This integral is the product of two functions, the first of which is a composite function and the second of which is the derivative of the first (composite) function's inner function. If the second function happens instead to be a multiple or submultiple of this derivative, we can still use this technique. We simply remove the multiplier and put it in front of the integral symbol. Once our integrand is in the required format, we can substitute u for g(x) and du for g′(x) dx so that we are left with:

 ∫ ƒ(u) du

We can then carry out integration with respect to u, and get our final answer in terms of x by back substituting for u. Unfortunately, not all integrals involving the product of two (or more) functions fall neatly into this category, so we need to find another way of dealing with them. To be specific, we turn to a technique called integration by parts. The technique gives us a rule for finding the integral of the product of two functions. Like u-substitution, it relies on substituting a variable for one of the terms in the integrand in order to simplify the task of integration. And, like u-substitution, it is a technique that requires a fair amount of practice before it can be used effectively.

Although integration does not have a product rule of the kind used in differentiation, integration by parts employs a technique that is closely related to it. Just to remind you, here is the product rule that we use for differentiating the product of two functions, u(x) and v(x):

 d (uv)  =  u dv + v du dx dx dx

Remember, the rule states that in order to find the derivative of the product of two functions, we must take the first function multiplied by the derivative of the second function, and add it to the second function multiplied by the derivative of the first function. If we drop the Liebniz notation, we can write this a bit more concisely as:

(uv)′  =  uv′ + vu

Suppose we now integrate both sides of this equation with respect to x:

 ∫ (uv)′ dx  = ∫ uv′ dx + ∫ vu′ dx

Now let's think about the definition of the indefinite integral for a moment. The indefinite integral, or antiderivative, of a function is the function whose derivative is equal to the original function. On the left-hand side of our equation we have the indefinite integral (i.e. the antiderivative) of (uv)′. The function whose antiderivative is equal to (uv)′ is uv. We can therefore rewrite our equation as:

 uv  = ∫ uv′ dx + ∫ vu′ dx

Rearranging things somewhat, we get:

 ∫ uv′ dx  =  uv - ∫ vu′ dx

This is the formula for integration by parts. We can write the formula in an even more concise form if we consider that the terms du and dv are both differentials of a function of x, so that:

du  =  u′ dx

and

dv  =  v′ dx

We can now rewrite the formula for integration by parts as:

 ∫ u dv  =  uv - ∫ v du

Which is all very well, of course, but how does it help us to solve integration problems? The best way to demonstrate how it all works is to work through a few examples. Before we do so, it is probably worth pointing out that integration by parts is not a magic bullet, nor is it an easy formula to apply. As with u-substitution, there are choices to be made regarding the substitution of functions - and it is very easy to make the wrong choices, especially when you have no previous experience of using this technique. Don't be too disheartened, therefore, if you take a few wrong turns.

Consider the following integral:

 ∫ xe x 2 dx

We can use substitution to solve this integral. We'll try the substitution u = x 2. Remember that we need to substitute for the differential dx as well, so we need to find du in terms of dx. Differentiating u will give us 2x, so:

du  =  2x dx

and therefore

 x dx  = 1 du 2

We can now carry out our integration and back substitute for u:

 ∫ xe x 2 dx  = 1 ∫ e u du  = 1 e u + C  = 1 e x 2 + C 2 2 2

As long as you are reasonably comfortable with the u-substitution techniques described elsewhere in this section (and provided of course that you remember that the integral of ex always evaluates to ex plus some constant of integration C), that problem should have presented you with no great difficulty. If you are still not sure what was going on, you should perhaps revisit the page "Integration by Substitution". Otherwise, let's look at another problem which, at first glance, looks quite similar. Consider the following integral:

 ∫ xe 4x dx

Integrating the x on its own would be a trivial exercise. Integrating the term e 4x would also present us with no great problems. Once they are multiplied together, however, it's a different story. Using u-substitution is not going to work here - we need to use integration by parts. Just to remind you, here is the formula once more:

 ∫ u dv  =  uv - ∫ v du

Note that on the right-hand side of the formula, we are differentiating u. This leads us to a general rule of thumb, which is to let u be the function that will become simpler when we differentiate it. Whatever is left will therefore become dv. If dv is something that is relatively easy to integrate, then finding v won't present us with any problems, because it is simply a case of integrating dv. If we make the right choices, therefore, it will make our lives a lot easier when we come to evaluate the right-hand side of the formula. So, here is the integral we want to solve once more:

 ∫ xe 4x dx

The x in front of the exponential term seems to have complicated matters. On the other hand, differentiating x would be a trivial matter, so it might be a good idea to make the substitution u = x. This means that our second substitution will be dv = e 4x dx. This leads us to:

du  =  dx

and

 v  = ∫ e 4x dx  = 1 e 4x 4

The integral now becomes:

 ∫ xe 4x dx  = x e 4x - ∫ 1 e 4x dx 4 4
 ∫ xe 4x dx  = x e 4x - 1 e 4x + C 4 16

You should by now be starting to grasp the general idea behind integration by parts. We use it when we have to find the integral of a function that is itself the product of two functions, and when other methods such as u-substitution cannot be used. The left hand side of the integration by parts equation is essentially the integral we are trying to find. The right-hand side of the equation then becomes the difference of the product of two functions and a new, hopefully easier to solve, integral. The most difficult aspect of using integration by parts is in choosing which substitutions to make. Sometimes it is necessary to try various alternatives before finding one that works.

Let's look at some more examples. Consider the following integral:

 ∫ 3x sin (x) dx

Our substitution choices here are fairly obvious:

u  =  3x

and

dv  =  sin (x) dx

Differentiating u gives us:

du  =  3

and integrating dv to find v gives us:

 v  = ∫ sin (x) dx  =  - cos (x)

Now we apply the integration by parts formula:

 ∫ 3x sin (x) dx  =  -3x cos (x) - ∫ -3 cos (x) dx
 ∫ 3x sin (x) dx  =  3 (sin (x) - x cos (x)) + C

Sometimes it becomes necessary to apply the formula for integration by parts to a problem more than once in order to solve it. Consider the following integral:

 ∫ x 2e 3x dx

Following the principle of letting u be a function that is easy to differentiate, it looks like our substitutions will be as follows:

u  =  x 2

and

dv  =  e 3x dx

Differentiating u gives us:

du  =  2x

and integrating dv to find v gives us:

 v  = ∫ e 3x dx  = 1 e 3x 3

Now we can apply the integration by parts formula:

 ∫ x 2e 3x dx  =  x 2 · 1 e 3x - ∫ 1 e 3x · 2x dx 3 3
 ∫ x 2e 3x dx  =  x 2 · 1 e 3x - ∫ 2 xe 3x dx 3 3

Unfortunately we still have an integral that is the product of two functions, so we're going to have to apply the integration by parts formula one more time. The substitutions we will make for the new integral will be as follows:

 u  = 2 x 3

and

dv  =  e 3x dx

Differentiating u gives us:

 du  = 2 3

and integrating dv to find v again gives us:

 v  = ∫ e 3x dx  = 1 e 3x 3

Putting it all together, we get:

 ∫ x 2e 3x dx  = 1 x 2e 3x - ∫ 2 xe 3x dx 3 3
 ∫ x 2e 3x dx  = 1 x 2e 3x - { 2 x · 1 e 3x - ∫ 2 · 1 e 3x dx } 3 3 3 3 3
 ∫ x 2e 3x dx  = 1 x 2e 3x - 2 xe 3x + 2 e 3x + C 3 9 27

We said earlier that the choice of substitution is the critical factor in determining whether your attempts to solve integration problems using integration by parts will be successful. So far, in the examples we have seen, we have been able to substitute u for a function that we can easily differentiate. We need to keep in mind, however, that whatever remains of our integrand will become dv by default, so we must be able to integrate it. Consider the following example:

 ∫ x ln (x) dx

From the examples we have worked through so far, it might seem like a good idea to choose the substitution u = x, since this would mean that du would be equal to dx. This would appear to simplify matters for us, but think for a moment about what will happen when we try to integrate the term ln (x) dx. We can't achieve this using the standard rules of integration. In fact, we don’t seem to be any further forward with the problem. This is an example of a case where what at first seem to be the obvious choices turn out not to be the best ones. Suppose we instead choose the substitutions u = ln (x), and dv = x dx.

Differentiating u gives us:

 du  = 1 x

and integrating dv to find v gives us:

 v ∫ x dx  = x 2 2

If we now apply the integration by parts formula, we get the following:

 ∫ x ln (x) dx  =  ln (x) x 2 - ∫ x 2 · 1 dx 2 2 x
 ∫ x ln (x) dx  =  ln (x) x 2 - ∫ x dx 2 2
 ∫ x ln (x) dx  =  ln (x) x 2 - x 2 + C 2 4

Sometimes we are asked to integrate a single (non-composite) function, which normally wouldn't present us with much of a problem. However, consider the following integral:

 ∫ ln (x) dx

On the face of it, this looks less complicated than the previous example we looked at. However, in order to apply the integration by parts formula here, we need to split the integrand into two functions. Usually, the easiest way to do this is to consider the function in question to be the product of one (1) and itself. If we use this technique here, we have:

 ∫ ln (x) · 1 dx

From what we have seen previously, it may seem reasonable to make the substitution u = 1, but this immediately presents us with a problem, because we then get:

du  =  0

What's even worse, however, is that we are then left with the substitution dv = ln (x) dx, which means that in order to find v we must carry out the following integration:

 v  = ∫ ln (x) dx

This looks somewhat familiar, doesn't it! Hopefully, you can see that these substitutions are just going to have us running around in circles. Let's try it the other way around, then. Our substitutions will be as follows:

u  =  ln (x)

dv  =  dx

Differentiating u gives us:

 du  = 1 x

and integrating dv to find v gives us:

 v  = ∫ dx  =  x

Applying the integration by parts formula gives us:

 ∫ ln (x) dx  =  x ln (x) - ∫ x · 1 dx x
 ∫ ln (x) dx  =  x ln (x) - ∫ dx
 ∫ ln (x) dx  =  x ln (x) - x + C

This result may look familiar to you, particularly if you have read the page "Basic Rules of Integration", since it appears under the heading "Indefinite integrals of some common functions" on that page.

## Integration by parts for definite integrals

Essentially, we can apply integration by parts to a definite integral by finding the indefinite integral, evaluating it for the limits of integration, and then calculating the difference between the two values. Strictly speaking, therefore, we don't really need a formula in order to find the definite integral using integration by parts. Nevertheless, here it is:

 ∫ b uv′ dx  = uv b - ∫ b vu′ dx a a a

Let's try an example. Consider the following definite integral:

 ∫ 2 xe x dx 0

It seems reasonable to make the following substitutions:

u  =  x

dv  =  ex dx

Differentiating u gives us:

du  =  1

and integrating dv to find v gives us:

 v  = ∫ e x dx  =  e x

Applying the integration by parts formula gives us:

 ∫ 2 xe x dx  = xe x 2 - ∫ 2 e x · 1 dx 0 0 0
 ∫ 2 xe x dx  =  (2e 2) - (0e 0) - e x 2 0 0
 ∫ 2 xe x dx  =  2e 2 - (e 2 - 1) 0
 ∫ 2 xe x dx  =  e 2 + 1 0

Let's look at one final example. The following integral should look familiar to you:

 ∫ 2 xe 4x dx -2

This is essentially the same integral to which we first applied integration by parts. The only difference is that now, instead of just finding the indefinite integral, we need to go a little further and find the definite integral using the limits of integration -2 and 2. Our substitutions will be as they were previously:

u  =  x

dv  =  e 4x dx

Differentiating u gives us:

du  =  dx

and integrating dv to find v gives us:

 v  = ∫ e 4x dx  = 1 e 4x 4

Applying the integration by parts formula, we get:

 ∫ 2 xe 4x dx  = x e 4x 2 - 1 ∫ 2 e 4x dx -2 4 -2 4 -2
 ∫ 2 xe 4x dx  = ( 1 e 8 + 1 e -8 ) - 1 e 4x 2 -2 2 2 16 -2
 ∫ 2 xe 4x dx  = 1 e 8 + 1 e -8 - 1 e 8 + 1 e -8 -2 2 2 16 16
 ∫ 2 xe 4x dx  = 7 e 8 + 9 e -8 -2 16 16

This result evaluates to approximately 1304.169 (if we limit our calculation to three decimal places), which is the correct answer.