 In the previous video, I made a promise that I'll offer some tips on how to use integration by parts properly, and so I now want to fulfill that promise. So integration by parts should only be used in the following conditions hold in your integral. So first of all, the integrand has to be written as a product of two things. There's got to be a product of some kind. You're going to see it's going to be the product of you and DV. You have to have two factors. Now, admittedly, this first condition, well, most of the times we'll be thinking integration by parts because, oh, we naturally see two factors. In the previous example, we saw e times, sorry, x times e to the 5x. So I have that natural factorization right here. Now, in other examples we'll see in this video, that the factorization will be obvious. Now, in some situations, though, if you have a function f of x and the factorization is not obvious, well, admittedly, you should always look at the dx. The dx is part of that. And sometimes that's the factorization you use. You use f of x times dx. And that might seem like, well, how will that ever going to be helpful? But we'll see some examples exactly when it is. So don't focus on the first one too much, but we do have to think of how it's going to factor. Now, because there are some options on how one factors it, how do you choose you and how do you choose DV? Well, principle B here, it should be possible. We have to be able to integrate DV. You can't choose DV to be such and such if you can't integrate it. That'll get you stuck. And we have to also differentiate you. So however you choose you and DV, we should be able to find the derivative of you. We should be able to find the anti-derivative of DV. If you're missing one of those pieces, integration by parts isn't going to get you any farther than you already done. So we have to find the derivative. We have to be able to find the integral of the appropriate parts. And then this third principle is the one that matters the most. The integral of VDU has to be found. We have to be able to compute this new integral that's gonna pop up. Generally speaking, the integral of VDU should be simpler than what we started with. It shouldn't be more complicated, but it is possible that if our integral is no more complicated than we started with, it turns out if you kick the can down the road long enough, we live on a round plan and if you kick the can down the road long enough, you'll make a big circle. And it turns out I'll show you a variation of integration by parts, which I call integration by cycles. That can show you that even if this thing is no worse than you started, that's actually still a step in the right direction. But let's look at two examples of how a typical integration by parts calculation works. We have an integral. We want to integrate the function x sine of x dx. There's a natural factorization. We have this x times sine of x. The dx is always gonna go with the dv, so that's not too much in subject here. There's no question about that. The question is where we put the x, where we put the sine. Now, we have to choose someone to integrate, which we call you. We have to choose someone to integrate, which we call dv. Now, if you look at x, if we take the integral, or if we take the integral of x, we're gonna get an x squared, you know, up to a constant multiple. But if we take the derivative, we're gonna get a one. x disappears if you take its derivative, but it gets more complicated if you take its antiderivative. That right there seems to suggest to me that I should set x equal to u. But let's see what's going on with the other side of things. What about sine? If you take the derivative of sine, you get a cosine. And if you take the antiderivative of sine, you get a negative cosine. So you're gonna get a plus or minus cosine no matter what you choose. So in some respect, it doesn't matter where the sine goes. The derivative or antiderivative, you're gonna end up with a constant multiple of a cosine. And the linearity property of antiderivatives tells you the sine, the plus or minus sine doesn't matter. And so because of that, it doesn't matter where you put the sine, but it doesn't matter where we put the x. We can simplify if we take the derivative of x, we complicate if we take the antiderivative of x. And so that's gonna guide our hand here. We're gonna set u equal to x, and hence du will equal dx. And we're gonna set dv to be sine of x dx. Don't forget the dx there. And then v is gonna equal, like I said before, negative cosine of x. And so if we use that choice for integration by parts, remember integration by parts, the formula is the integral of u dv we equal uv minus the integral of v du. So putting those parts all together here, we end up with x times negative cosine of x minus, pay attention to the minus signs here. We're gonna get integral of v, which is negative cosine. You have to be very cautious here because the derivative and antiderivative of the sign is very similar. We have to be very cautious. Should we have a plus or a minus in front of my cosine? In this case, since we're taking antiderivative, it should be a negative cosine. So v is negative cosine, then we get du, du is just an x. So notice here, if we simplify this, we get negative x cosine of x. That part of the antiderivative is already done. We took that part. Then we get a plus integral of cosine of x. So if we look at the last principle, are we in a better situation than we were before? Can we find the antiderivative of cosine? And the answer is, yep, the antiderivative of cosine is a sign. And so taking the antiderivative there, we get negative x cosine of x plus sine of x plus a constant. And do notice it'll be a positive sign because we're taking the antiderivative of cosine, not the derivative of cosine. And you could verify by usual derivative techniques that the derivative of negative x cosine x plus sine of x plus a constant is in fact x sine of x. And so we were able to use those guidelines for integration of parts to help us find the antiderivative. We chose u and dv to make the integral simpler and the new integral was something we could calculate. Let's look at another example. This time, let's look at the integral of 2x squared e to the negative 3x. So we see this natural factorization. There's a factor of x squared. There's a factor of e to the negative 3x. The dx will always go with the dv and then the two can go wherever we want because it's a constant multiple. So we have to choose a u and we have to choose a dv. Now, generally speaking, putting monomials for u is a good idea because when you take the derivative of a monomial, it's always gonna be a monomial and oftentimes it'll be a simpler monomial. That is the power will be smaller. On the other hand, the e to the negative 3x, kind of like sine, it doesn't really matter where you put it. If you take the derivative of e to the negative 3x, you're gonna get a negative 3 times the exponential again. If you take the antiderivative of it, so we take e to negative 3x dv for dx, for example, its antiderivative is gonna be a negative 1 third e to negative 3x. And so whether you take the derivative or the antiderivative of this exponential, you're gonna get a constant multiple of that same exponential. And although we might prefer integer over a fraction here, constant multiples don't make much of a, they don't have much of a consequence on the integration. So whether you take the derivative or antiderivative of the exponential, you're gonna get the same thing. It was gonna get exponential again. But by placing the power function 2x squared in for u, when you take its derivative du, you're gonna get 4x dx. You'll notice that the power of x goes down by one. And so applying this to integration by parts, we end up with a u times v. So we're gonna get a negative 2 thirds x squared e, that doesn't look like an e, e to negative 3x. Now we're gonna subtract the integral of v, which was negative 1 third e to negative 3x times du, which is 4x dx. Like so, simplifying the integral, we end up with negative 2 thirds x squared e to negative 3x. I didn't do anything to that. We're gonna get a plus 4 thirds integral of x e to the negative 3x dx. So does this new integral put us in a better position than we were before? And I would say the answer is yes, right? Could we find the integral, the anti-derivative x e to the negative 3x? Well, maybe I don't know it off the top of my head, but it's like, oh, we could just use integration by parts again, right? Can we do it a second time? We're say u equals x, so du equals dx, and dv would equal e to the negative 3x dx, and hence v would equal again negative 1 third e to the negative 3x. Because if we were to do integration by parts a second time, the power of x will go down one more time, and eventually this process will end. Because we had an x squared to begin with, we have to do integration by parts twice. If we had like x to the 12th, we could do it 12 times. That would be a long exercise. I didn't assign one that big. But in principle, we could reduce the power of x by doing integration by parts over and over and over and over again. Eventually, the power of x will disappear. And so if we do that, we're just gonna copy the piece we had before, the negative 2 thirds x squared e to negative 3x. Now we're gonna get plus 4 thirds, and make sure this 4 thirds distributes on both parts because this integral will be replaced with two parts. We have a new unv, which is gonna be negative 1 third x e to negative 3x, and then we're gonna subtract from it the integral. We're gonna get v again, which is now negative 1 third e to negative 3x times dx, like so. So in this situation, do distribute the 4 thirds onto both pieces here. And so we have two parts of the integral calculated. We have the negative 2 thirds x squared e to negative 3x. That part's just on for the journey this time. It's not gonna change. We now get a negative 4 ninths x e to negative 3x, and we have a positive 4 ninths integral of e to negative 3x dx. And so since we're using integration by parts twice, we didn't have to ask ourselves the question the second time. Is this last integral in a better position than we were before? And the answer is yes. We've now integrated e to negative 3x twice now. We know it's anti-derivative. It's gonna be a negative 1 third e to negative 3x. And so applying that, we get all of this one more time, negative 2 thirds x squared times e to negative 3x, negative 4 ninths x e to negative 3x. And then we're gonna get a minus 4 over 27. I'm taking 4 thirds times negative 1 third e to negative 3x, and don't forget your plus c. And this gives us our anti-derivative. All right, I'm gonna put a nice box on it, maybe a bow for Christmas time, because it's just so wonderful. That's my pretty bow right there. And we get our anti-derivative. Now, integration by parts is a technique that we do by parts. Imagine you have this six foot sub-same that you have to eat. No one's gonna eat it all in one bite. Therefore, you have to take small bites, bite after bite after bite, that'll get you through the entire problem. Some can be done in two bites. Some, like this one, can be done in three bites. And more complicated ones can be done in much more bites if you had to. This process can be iterated by doing it over and over again until all the powers of X are exhausted.