 In this video we'll work through two examples applying the method of integration by parts. One will be an indefinite integral and the second will be a definite integral. Consider the integral e to the x sin x dx. Since this is an integral of the product of two functions we can apply our new method. Let's suppose that u is equal to e to the x and dv is sin of x dx. With these choices, du dx is then e to the x, which tells us that du is equal to e to the x dx. Also with this definition of dv, v is then equal to negative cosine of x. So using our technique, this is equal to u times v, which is negative e to the x cosine x, minus the integral of negative e to the x cosine of x dx. Cleaning this up we have negative e to the x cosine of x plus the integral of e to the x cosine of x dx. This seemingly looks like we're in the same spot as we were at the beginning. However, let's proceed by applying the method again this time on the integral of e to the x cosine of x dx. Suppose in this case we're going to let u equal e to the x and dv will be cosine of x dx. du would then be e to the x dx and v would be sin of x. This then gives us that this entire integral is equal to negative e to the x cosine of x. Plus e to the x times sin of x minus the integral of sin of x times e to the x dx. Now what we see here is this integral right here is identical to the one that we began at the beginning of the problem. Well, in that case, they're like terms. If I can add this integral to both sides of the equation, I then get two of these integrals of e to the x sin of x. Again, because this integral is identical to the original, I'm adding it to both sides of the equation, leaving me with two of them on the left equals negative e to the x cosine of x plus e to the x sin of x. And in order to ultimately solve for our original integral, we divide both sides by two, leaving me with the integral of e to the x sin of x dx equals negative one-half e to the x cosine of x plus one-half e to the x sin of x. And we want to compensate for this indefinite integral by adding our constant c. And of course, remember that you can check your result by differentiating. Also, pause this video and use a different definition of u and dv than was used in this video to see if you obtain the same result. Let's consider the integral now from 0 to pi of x sin of 2x dx. I'm going to let u equal x dv equals sin of 2x dx. With this choice, du is equal to dx and v is equal to negative one-half cosine of 2x. Using integration by parts, we see that u times v is negative one-half x cosine of 2x. We're going to evaluate that from 0 to pi minus the integral from 0 to pi of v du. That gives me negative one-half cosine of 2x dx. I have a minus a negative here, which then gives me plus, so we have this integral shown here. We can evaluate this integral, that is one-fourth sin of 2x evaluated from 0 to pi. And we have this first antiderivative evaluated from 0 to pi. This gives us negative one-half pi cosine of 2pi minus negative one-half times 0 cosine of 0 plus one-fourth sin of 2pi minus one-fourth sin of 0. We know that both of these terms are equal to 0, as is this one. So we evaluate, we have negative one-half pi times cosine of 2pi, which is 1. So our final result is negative pi over 2. We'll further expand our toolbox of techniques of integration in the lessons to follow.