Integration by parts twice
By Murray Bourne, 12 Nov 2010
When we first learn how to integrate, the examples we see involve simple polynomials, or single functions like these:
Integrals of products
What if we need to find the integral of a product of 2 functions, like the following example?
This is where we need the important and useful technique in calculus known as integration by parts. (You can see a full explanation starting from basic principles and with more examples here: Integration by parts).
To find this integral, we choose "u" such that its derivative is simpler than u. In this case, we will choose u = x and proceed as follows:
|u = x||dv = sin x dx|
|du = dx||v = −cos x|
We apply the integration by parts formula and find the integral:
Tidying this up gives:
Now, that last integral is easy and we can write our final answer:
Note 1: The constant of integration (C) appears after we do the final integration.
Note 2: Choosing u and dv can cause some stress, but if you follow the LIATE rule, it is easier. For u, choose whatever comes highest in the folloentrwing list, and choose dv as the lowest in this list.
L - logarithm functions
I - Inverse trigonometric functions
A - Algebraic functions (simple polynomial terms)
T - trigonometric functions
E - Exponential functions
Integration by parts - twice
Now, let's see a case that is double-barreled. That is, we don't get the answer with one round of integration by parts, rather we need to perform integration by parts two times.
In this example we choose u = x2, since this will reduce to a simpler expression on differentiation (and it is higher on the LIATE list), where ex will not.
|u = x2||dv = exdx|
|du = 2x dx||v = ex|
Now for integration by parts:
We re-arrange this to give the following, which I call equation :
This time we can't immediately do that final integral, so we need to perform integration by parts again. Choosing "u" so that its derivative is simpler than u again, we have:
|u = x||dv = ex dx|
|du = dx||v = ex|
Note that the u and v here have different values from the u and v at the beginning of Example 2. This can be a trap if you don't write things carefully!
Now we proceed using integration by parts on :
That last integral is simple, and we get the following, which I call equation :
But we haven't finished the question - we must remember we are finding this integral:
This was our answer to the first integration by parts:
Substituting answer  this into equation gives us:
Tidying this up, we obtain the final answer:
Notice the place where the constant "+C" appears in our answer - it's after thel integration has been performed. (Some students get hung up on this step, or add the "+C" before it is appropriate, and some forget to add it at all!) I have used a subscript 1 on the first constant since it is not the same value as the final C.
Integration by parts twice - with solving
We also come across integration by parts where we actually have to solve for the integral we are finding. Here's an example.
In this example, it is not so clear what we should choose for "u", since differentiating ex does not give us a simpler expression, and neither does differentiating sin x. We choose the "simplest" possiblity, as follows (even though ex is below trigonometric functions in the LIATE table):
|u = ex||dv = sin x dx|
|du = ex dx||v = −cos x|
Apply the integration by parts formula:
We obtain the following, which I'll call equation :
Now, for that final integral:
Once again, we need to decide which function to use for u, and settle on the one which gives simplest derivative:
|u = ex||dv = cos x dx|
|du = ex dx||v = sin x|
Applying integration by parts for the second time:
We obtain equation :
Wait a minute - we have a final integral that is the same as what we started with! If we kept going, we would go around in circles and never finish.
So we need to perform the following "trick". We substitute our answer for the second integration by parts (equation ) into our first integration by parts answer (equation .
Removing the brackets:
Now, this equation is in the following form:
p = −q + r − p
To solve this for p, we just add p to both sides:
2p = −q + r
Then divide both sides by 2:
p = (−q + r)/2
So we will do the same to our integral equation, number .
I add to both sides:
Dividing both sides by 2 gives:
So we have solved equation  for , giving us the desired result.
(Note I used a "+K" for the first constant that appeared. My final "C" has value K/2, but normally we only need to be concerned with the final constant.)
See the 31 Comments below.