 Let's take another look at an example of an integral which you can calculate using integration by parts. Now this technique is going to be a little bit different than the previous examples we've seen, and I'm going to show you why it's going on here. So we see a natural factorization. There's e to the x and there's sine of x. That product makes me think I want to use integration by parts, but which factor is going to be who? We have to choose a u. We have to choose a dv. e to the x could be u. It could be dv. If we take the derivative of e to the x, it would just be e to the x again. If we take the derivative of e to the x, if we take the antiderivative of e to the x, it would also be e to the x. So it really doesn't matter whatsoever which pigeonhole you put e to the x in. It's going to give you the exact same thing either way. So let's then yield to sine. Where do you want to go sine? Well, if we take the derivative of sine, we're going to get cosine, but if we take the antiderivative of sine, we're going to negative cosine, in which case whichever pigeonhole we would sine in, we're going to get plus or minus cosine, which really doesn't make much of a difference either. So it almost doesn't matter. This is a situation which however you sort of crumble your cookie, you're going to get the exact same thing. So that's super awesome. So let's go with the first one I said. We'll put e to the x in for u, which then gives du as e to the x dx. And let's make dv be sine of x dx. And that then makes v become negative cosine of x. You could swap things the other way around and you would get the exact same thing basically. It makes not much of a difference here. So but hey, we can factor it and we can take the derivatives and integrals of all the pieces. If we use integration by parts, we're going to get negative e to the x cosine of x. And then because it's a double negative, we're going to get plus the integral. That's actually why I chose this direction so we could get a positive right here. We're going to get plus e to the x cosine of x dx. In which case now we have to compute the integral e to the x cosine of x dx. That looks almost the exact same from when we started with e to the x sine of x dx. It's not exactly the same because we have a cosine now instead of a sine. But fundamentally this seems to be about as complicated as we had before. We have an exponential times a trig. We have an exponential times a trig. This doesn't seem like we're in a better situation than what we started with. But then I tell you patience young grasshopper, trust in your master here. What I mean is this, this is actually a great situation. We are no worse than we were before. Kick that can down the road a little bit more. Now we want to take, we're going to take the integral of e to the x cosine using integration by parts again. So we have to choose a u and we could choose a dv. And it kind of feels like the same choice e to the x. It doesn't matter which direction you go in. You can take its derivative, you can take its antiderivative e to the x. Similar things with cosine. If you take the derivative or antiderivative of cosine, you're going to get a plus or minus sign depending on which direction you go. It doesn't feel like it matters. Now, because this is the second time we're doing integration part, it does matter a little bit. If we put e to the x as the antiderivative and we put cosine as the derivative. When we go through this calculation, we're going to undo everything we just did. And that's not a journey we want to do. Basically, we walked a mile down the road and we walked a mile back. That's not going to be helpful for us. So what we need to do is we need to respect the same order we did before. Since we took the derivative e the first time, we're going to do it again. So the derivative is going to be e to the x again. And since we took the derivative of the trig function first, the antiderivative trig function, excuse me, we're going to do the same thing here. The antiderivative cosine. Keep the same pairing that we had before, even though sine and cosine are swapped now. The antiderivative cosine is going to be sine. All right. Again, this might feel silly, but let's keep on going with what we have. If we keep on going, we're going to get negative e to the x cosine of x. So we have what we, that's what we have from before. Next, we're going to get a uv, which is an e to the x sine of x. Now we're going to get a minus the integral of e to the x sine of x dx. And now you're like, what the heck is going on here? This is the exact, exact integral we started with, right? This is what we already did. In which case you might go back here. It's like, what is going on? This is the same integral we started with. What's going on here? How does this helpful? It feels like all of her efforts were wasted in one big circle that back to where we started with. But I want to point out to you that this is actually good news, not a disappointment. Because what students, and it's not just students, but what many people forget when they're working on a math problem is you have all these, you have all these calculations, right? So you, you start off with, you start off with this thing right here, then we computed this, then we come down and we compute this one right here, right? And we kind of forget that, because when we write them in steps, we think of this like this process, like we're writing a story. Here's chapter one, here's chapter two, here's chapter three. But this isn't really a story. This is all just one sentence. Sometimes when we write the steps of our, when we show our work, we forget that this is inequality. And when it comes to an equation, there's two sides of the equation, the left-hand side, the right-hand side. This quantity right here is equal to something. What is it equal to? It's equal to the previous quantity, which itself is equal to, equal to what? Equal to the original expression, integral of e to the x sine of x dx. And if you treat this now as an equation, what we have here is you have this integral and the same integral on both sides. These are like terms. What happens if we try to add or combine like terms? Well, what you can see is we're going to add the integral of e x sine of x to both sides of the equation, add it to the right-hand side for which they'll cancel, but then add it to the left-hand side and they'll combine to give us two of those. So we get two times the integral of e to the x sine of x dx. And this is going to equal e to the x sine of x minus e to the x cosine of x. And because there's no longer an integral on the right-hand side, we do need to have a plus c, so we have the correct antiderivative family. And what we're interested in, remember, is this guy right here, we want to know what this antiderivative is. Well, if we divide both sides by two, that does it. And so in the end, we end up with the integral of e to the x sine of x dx. This is equal to one-half e to the x sine of x minus one-half e to the x cosine of x plus a constant. And taking the derivative of this puppy gives you the correct function e to the sine of x. And that's pretty cool, right? We took integration by parts so many times that you eventually cycled back to where you were. We took this kind of illustration we had here. We had a sine of x. And then we did integration by parts. It became a cosine of x. And then when we did integration by parts, again, it cycled back to sine of x. And so we were to use the fact that we reproduced the original integral in this equation and we could solve for it algebraically and get the integral. And so this is a variation of integration by parts that I often like to refer to as integration by cycles. And integration by cycles is a very nice technique. If by repeating the integration by parts process, you'll eventually cycle back to the original integral. If that's a possibility, then you can find the anti-derivative using this integration by cycles technique. It works really nice. It's slightly different than how the previous integration by part techniques work. And to use it effectively, one has to be somewhat predictive on what's going to happen. When I take the next step, where does that take me? When I take the next step, where does that take me? Even if you only intuitively know where you're going, if you can see that the cycle is going to happen, then that can be a fundamental step to know how one wants to find an anti-derivative here. And so that brings us to the end of our lecture, lecture nine here. In lecture 10, we're going to do some more examples of integration by parts. So take a look for those. And like I said, that finishes lecture nine for today. Thanks for watching. Please post any questions you have in the comments. I'll be glad to answer them. Like this video. Subscribe to this channel so you can get more updates about these calculus videos in the future. And I'll see you next time. Bye, everyone.