 One thing I want to emphasize, which I said before but I'll say again, the answers on the web assignment need to be exact so if the answer is 1-third, going 3-3 is not correct. If you got burnt by that on the first assignment, do a ask your teacher and say, I didn't know any better and we'll give you the points back. In general, we don't want to do that but since it's, you know, time to learn stuff, so you get the hang of it, if you feel that you've been robbed by the grading on web assignment, you want to ask your teacher and we'll look at your answers and we'll decide whether you were robbed or not and give you your points back. It's not our goal to beat you into the dirt, it's our goal to measure whether you know how to do this stuff. The second assignment is due on Wednesday morning, so it's about 48 hours from now. The extra credit has now expired, so now every question is worth one point. Anything you have after over the weekend is worth a point and a half and I'll put up the next assignment precinct that we do the next Wednesday and extra credit goes until Sunday night. Any questions? Issues? Stuff? No? Okay, that would be sad. This is going to be our first full week of classes. Nice change. So if you remember what we've been doing is working on techniques of integration. So it's still sort of here. Last time, you did a lot of substitution. You did a lot of substitution, no. The next homework assignment does a lot of substitution questions, but at the end of the class, I introduced the idea of integration by parts, which is essentially the product rule written for integrals. So it says that if you have an integral, and it's in its usual form, which looks like a function because of the derivative of another function, then this is the product of those two functions minus the integral. Now we get to take the group, we get to integrate this guy and take the derivative of this guy. There are a number of little demonic methods that people may have learned, like the Zorro rule and little tables and things like that. That's fine if you want to use them. The problem with, say, the Zorro method is if you write something in the wrong place, then Zorro gives you the wrong answer. The same thing with memorizing the formula of a form of a table. If you write the formula of a table wrong, the answer is wrong. So let me remind you, this is just the product rule written sideways, right? The product rule says that the thing is the derivative times the thing, the product of the two things, so you just write it. So the product rule for derivatives says, let me just write it, the derivative times, I guess, UV prime is UDV plus VDU. And so if we just integrate the product rule and rearrange, we get this. And it's just another way to get to the problem. So essentially, even though we're going to focus on techniques of integration for another week or two, there's really two techniques of integration. Substitution and there's parts. That's pretty much it. You don't know the difference. So there's substitution, which we did last week, and you get in your previous course. Substitution. It was my place when I started writing. Substitution. Integration by parts looks like just some silly formulae. It's a bit of a powerful technique that lets you rearrange something in terms of something else. So there's substitution. So I'm going to do a few examples of integration by parts. So say the integral, something easy first, x times the sign, the x dx. So the trick in parts is we want to look for one part, which is U. So U is simpler, whatever that means. And another part, so that's the derivative part, is an integral you can do. Looking at this, in terms, to my mind, two obvious choices. Only one of which works. The other one makes it worse. If anybody wanted to make a suggestion, what I might let U be, x. So if I let this be U, well actually let me write it nicely. So I'm going to let U be x. And then once U is x, dv is force-fund. And again, it's important to write the dx because if you don't, then sometimes you forget which one you're integrating and which one you're differentiating. It's not as important as in substitution where the dx actually measures something. Here it's just reminding you that this is the derivative of the thing. So if U is x, then we need to know what du is. So what's du? So I'm hearing a few people say one. It's not one, it's one dx. So it's just dx. And then v, if dv is the sign, then the integral of the sign is the cosine, except it's negative. So v is negative cosine. There's a plus c, but I don't care about it. Let me just point. And so now, I guess I'll do over here. So now we have, using parts, the integral of x sine x dx is, and then the formula tells me it's this times this minus the integral of this times this. So that's the Zoro business, I guess. So it's uv. So u is x and v is cosine x. Did I lose a minus sign? Well, it's there. It's just not here. And then it's minus the integral of v, which is a minus cosine x. Let me put the minus sign here on the left side. dv. And dv is just dx. So here it's important to remember the dx so that you don't wind up with integral without dx. And now this is an easy integral. Just the integral of the sign, we just did it. So this is minus x cosine x minus minus is plus. And then when I integrate cosine, maybe I don't, let me not do that. The integral of minus cosine x is minus sine x, and then I get a constant. So the full answer, x cosine x plus sine x plus a constant. Anybody confused? Have a question? How many of you have done integration by parts before? OK. So I guess maybe I don't need to belabor this. How many of you have not done integration by parts before? Well, then I do need to be labored. OK. They didn't embrace their handful. So this technique is pretty straightforward. The hardest thing in integration by parts is picking out what is good to do first. Let me do another example. So this one integrals the log. Doesn't look like something you could do. There's no substitution to make unless you're really clever. There are sort of, I don't know, but in fact there are two parts sitting there, and there are parts you can deal with. So let's let you be the log, b, let you be 1, c, let you be dx, d, let you be 1 over x, and e, let, you just can't do it. Right? They should both be open now for whoever says it's not. Yeah, I know it's open. Both of them. Both of them have an input. Because I already have seven answers on the table. So if you're having trouble getting your clicker to work it's channel 41. It looks like I have most of the answers. Anybody need more time? OK. So I think I have all the answers except hers. She's going to hurry. She's done. Somebody keep changing your mind. You can't see a little graph going up and down. Did you get it yet? OK. I'm stopping the clickers. So I'm stopping them both. Stop, stop. So 68% and it's this, 13% and it's this, and it's none of these. OK. So I'm at parts here. There's this part and this part. And if you use the little rule that's over here somewhere, if we take the derivative of the log, it becomes 1 over x. So that's something simpler. I guess 1 over x seems simpler to me than the log. And we can integrate dx to get x. So this would be a good thing. If we try this, when we take the derivative of 1 we get 0. That's not going to be so nice. Because we'll just get that the integral is 0. And then we can't integrate log x dx anyway. Because that's a little point. So again, we don't know what to do. So if we use v, so I'm going to let you be 1. And then so I guess dv is log x dx. And then du is 0. And then v is whatever the integral of log x dx is. Well then that tells me that the integral of log x dx is, wait a minute, I've used the sign somewhere. Tell you that's right. You know, this isn't giving me anything useful. Somewhere I'm missing a sign. Let's get the plus. It's useless. This is not what I want to do. And in fact, we never want to let you be 1. Because it doesn't get you anywhere. So this is gone. Sometimes you let you be dx. And you can't let you be dx either. So instead what I'm going to do is I'm going to let you be the log and dv be dx. And then du is 1 over x dx. And I can integrate dx to get x. And so now this becomes this times this minus the integral of v du. And x times 1 over x is 1. So this becomes x log x minus the integral of 1 dx. The one there. Which is x log x minus x. That wasn't true. Now often when it's easy, and I should have done it before, it's worthwhile because derivatives are easy to check your answer. Especially in integration it's easy to make some stupid mistake. And derivatives are in general easy. So we can take the derivative of this and make sure we get the log back. So it's really worth doing that. So we just take the derivative of x log x minus x. And when we take the derivative, we have to use the product rule here. So the derivative of x is 1. At least put the log x line around. And then x times the derivative of log x, which is 1 over x, minus the derivative of x, which is 1. Plus the derivative of constant, which is 0. And so I get log x plus 1 minus 1. So that's log x. And so that's good. So that was easy. And if I had made some silly mistake up here like putting a plus sign, then I would get a plus sign here. And if I wouldn't get 0, I wouldn't get the log back. And I would know that I made some silly mistake. So it's worth checking when it's easy. If checking takes longer than doing the problem, it's probably not worth it. But here this is an easy check. I should have checked that one. But I'll leave that one for you. What else do I want to do here? So sometimes, Pyrox is useful. Even though it doesn't look like it, there's a famous story for a, do you know who Peter Lacks is? No? So he's a famous mathematician. He won the National Medal of Science about 15 years ago. And when somebody asked him what he did to win the National Medal of Science, he said, oh, I integrated by parts. So he used integration by parts in a very clever way to solve some partial differential equations. But, you know, he just said, oh, I just did integration by parts. So it's a powerful technique. Okay. I know there's something else I've got to do here. Let me do another one that is maybe slightly less obvious. Suppose I have something like the integral, oh, let's go with, okay, e to the x sign of x dx. So here, certainly I can use integration by parts. I mean, my rule of thumb says, look for one part that du is simpler and another part where you can do the other part. So what should I take u to be? Sign x. Okay. So I don't know that du is any simpler, but it's certainly there. And I can certainly integrate e to the x. So that's okay. And so my parts, this tells me that this must be u v minus the integral of v du. So that's minus a minus e to the x cosine x dx. Doesn't it look like, did I make a mistake? Okay. So, oh, because I'm stupid. I would have made the same mistake a second time around and it wouldn't have made it. So that doesn't look like it helped. But, you know, maybe we can try it again and see if it gets any better. So let's try again, not try another integral, but let's try this part here by parts. So now in this piece, I want to do this by parts and I'm going to play the same trick. I'm going to let u be the cosine and so du, now I get a minus sign, is minus the sign and dv is e to the x. So v is dx, is e to the x. And so that means that this whole thing becomes, well, I get this from before, let me write it down again. I still have this e to the x sin x floating around from before. Let me just rewrite the whole thing. This is from before and then minus, and now when I do parts here, I get e to the x cosine x and then I get minus e to the x, I get minus a minus sin x. And then vx, I get an e to the x. Just like we didn't get anywhere, and somewhere I have a mistake. Where's my mistake? No, there's a sign wrong. It's like g again. Oh no, no, no, there's not. It's fine. So if I distribute the negative, I get the thing equals e to the x sin x minus e to the x cosine x plus itself. Well remember what we're doing. We're trying to solve for something, trying to figure out what this integral is. So that means, if I distribute the minus here, I have two of those guys and you're just weighing this one over here and add them together to get that, well I don't know what that integral is, but twice it is e to the x sin x minus e to the x cosine x. Well if twice it is this, then the integral I want must be half of that. So sometimes integration by parts doesn't seem to go anywhere, but you can get back where you started. Now if I had taken the part to be e to the, if I had taken u to be e to the x, instead of taking u to be the sin, I would have gotten the same integral. Well I know what it's done because I have the integral, yeah? An integral equals some junk minus itself. So since I have a thing equals some junk minus itself that means that twice the thing is that junk. Now if I had done a slightly harder version, which I think would work on the homework, no! Like if that had been an e to the 2x or a sin of 3x or something like that, then instead of being this thing equals some junk minus itself, it would be this thing equals some junk minus 5 times itself. But this still is the same trick. I get something expressed in terms of some extra stuff plus itself. So that means I can solve for the thing I want. This is not obvious. But once you see it then it is obvious. Well it's supposed to be sort of a reasonable, so the rule is instead of simpler, how about not worse? Because if it's the same and it's always going to be the same, then you get back where you started. So there is an order, essentially, the thing that you want to try letting your U be first is the ugliest thing that gets better when you take the derivative of it. So something like inverse trig was pretty ugly. And when you take their derivative they become rational functions. Logs and exponentials, well log gets better exponential not so much. Trig functions, well they don't get worse. exponentials, they don't get worse. Polynomials, they get better. So there is some kind of an order and there's some, does anyone know this mnemonic is like? Yeah, so there's some mnemonic that you can use. Logs are good, inverse trig are almost as good as logs. Algebraic? Yeah, algebraic things, trig, exponential. So you can remember that. Well remember it is the thing that gets the nicest when you take its derivative is best to do first. So logs are horrible because they're this transcendental thing. But their derivative is 1 over x, come on. Inverse trig, they're also pretty horrible. Inverse tan, but it's derivative not so bad, 1 over 1 plus x squared is nicer than inverse tan. Algebraic things, when you do the derivative, you read those things. Trig, well it doesn't get worse, exponentials, they don't get worse. So if you want to memorize this little thing, okay, obviously you can tell, I don't know what it is, just think about it. I guess in that case we're going to do one other thing that's appropriate. So, okay, so this fact is true only if x is positive, but if x is negative, then we have, this doesn't make any sense. So this is true as long as x is in zero. And we'll deal with what if x is zero in about two weeks. So this is true, so when do you have to, when x is negative? If we are sloppy and leave them off, it's not wrong. I mean, most people know that it's okay to leave them off most of the time, but sometimes it's important. And then answer your question at all. Okay, so let me do say another relatively easy one. So this one is really just like the other one. I'm going to have to do integration by parts a couple of times on this one, right? Because here, obviously, if you want to use that little formula or you just want to think about it, I think the derivative of x squared becomes a 2x. That's nicer because it's a lower power. The derivative of sine, integral of sine 2x is something I can do. So if I take the derivative of sine 2x, it becomes a 2 cosine 2x. So better, the integral of x squared is one third x cubed. That's worse. So I don't really want to do that unless I have to. So it seems obvious to me that we're going to let u be x squared. So du is 2x dx. We'll let dv be the sine of 2x. So v is, well, I can deal with this 2, so in my mind I make the substitution, w equals 2x. So dw is 2 dx, so I pick up a half. So this is 1 half cosine 2x, except I need it to be negative. OK, so this becomes uv minus the integral of v minus 1 half cosine 2x du, du is a 2x. And then this 2 cancels that 2, but the negative from the cosine changes the sine integral. OK, and so, well this is almost like what I just did. Again, I'm going to have to do the integration by parts to get rid of this x. But when I take the derivative of x, I get a 1, so that's going to be good. So this is, this guy is coming from before. And then here, I'm going to let u be x, so dv is dx, that's good. And I'm sorry, that's u, du is dx, dv is the cosine, and so v is 1 half the sine of 2x. And so now this thing just comes along for the ride, minus x squared over 2 cosine 2x minus uv, so that's minus 1 half x sine 2x minus the integral of v du. So v is a 1 half sine 2x du dx. We're almost done here. Then a little business is x squared over 2 cosine 2x minus x over 2 sine 2x plus, well I get a 1 half, the integral of sine 2x is 1 half cosine 2x, except it's negative, so we change the sine again. So I'm pretty sure that's right. It's probably worth taking the derivative to check. See that's why I should check. Yeah, I'm pretty sure that's, yeah, because otherwise these won't cancel. Yeah. Okay, so let's, well let's check that it works. And then if it works we go back and see where it's came from. If it doesn't work, go back and see that it's screwed up. Which is not unheard of, as you know already. Okay, so let's check this. So if I take the derivative of x squared cosine 2x, the derivative of x squared over 2 is x, but it's negative, and then minus x squared over 2 times the derivative of cosine 2x, which is a 2 sine 2x, except it's negative, which changes the sine back. So that's the derivative of this bit. And then we have minus, which x over 2 is derivative of 1 half, and we have minus, well I already have minus, x over 2, and then the derivative of sine 2x is 2 cosine 2x. So those 2 cancels, that'll be good. And then here, the derivative of 1 quarter cosine 2x is 2 sine 2x, instead of positive. And now let's just check that everything in sight cancels, except x sine 2x. Something looks wrong here already. Did I screw up? Probably. Okay, so this is a 2 sine 2x, and this is an x cosine 2x, x squared, there should be another x squared, oh no, I started with x squared. Okay, good. So here's my original integral, x squared sine 2x is what I started with. This x cosine 2x cancels with this x cosine 2x, because it's minus. One of the signs is wrong. Nobody heard that. Okay, so somewhere I made a sine error, I want this to cancel with this, but somewhere I have a negative sign wrong. Yeah, probably. So let me just check that the other bits cancel, and then it'll help me find out where it's wrong. And then this guy certainly cancels with this guy. So what do you mean, wait, wait, wait, wait. This is a 1 half sine 2x, this is a minus 1 half sine 2x. So they cancel for sure. So there's this trouble here, and she found it, which is good. So where is it? You found it, how many are there? Right here? That should be a plus. That makes sense. So why is this a plus? Because this is minus minus. Oh yeah, I just copied wrong. Okay, this is why you should check. Okay, so this plus now becomes this plus, plus is the 1 half x sine 2x is this one. Can you copy my own writing? It's good. And this still says negative, so it's good. So now it's right. Okay. So we're checking. Yeah. The tabular method is really the same. It's the same. As long as you can make it clear what you're doing. So the tabular method is the same as this. It's just a little more organized. It's the same. The only thing, the only problem that I have with the tabular method is that when you're doing something like this, sometimes, look, it works if you pay attention. What the tabular method is doing is just organizing everything in little rows and columns and you don't bother to rewrite those things that you already have. The problem would not bother to rewrite them until you get to the end is that you forget about them in the middle. And so you can wind up with, you need to use them sometimes. So the problem I have with all of these variations, they're fine as long as you know what you're doing. But a lot of times there are shortcuts. Shortcuts don't always work because you're taking a shortcut through the woods and then you run into a bear trap. It's not a good idea. So shortcuts are fine as long as you understand that they're going to work. But I don't mind about the tabular method. I'm not going to teach it because it doesn't always work. I mean it does. It's harder when it doesn't want to work. Okay. I know there's another thing I need to say. Okay. These things also work just fine with definite integrals. And usually with definite integrals, so these are ones with bounds on them, you want to... Oh, two things I need to say. So before I say definite integrals because that's sort of obvious. Suppose I have something, since I'm sticking with the sign I might as well let's do the cosine function. Suppose I have x to the 23rd power e to the x dx. I am not going to do this every time. If I do integration by parts, e to the x is not going to get me better. It's not going to get me worse. The x will become an x to the 22. Let me just do it once or twice. So we let u be x to the 23rd. So du is 23 x to the 22. dv is e to the x. v is e to the x. And so this is 23x to the 22 e to the x minus the integral of 23x to the 22 e to the x dx. Let's do parts again. So if I do it again u is x to the 22. du is 22x to the 21. dv is e to the x dx. v is e to the x. So when I do parts again for before I have this and then I get 23 times. And so I get 22e to the x x to the 22 e to the x e to the x still too early. This is x it's uv thank you. This one's right. So here I get x to the 23 e to the x minus 23x to the 22 e to the x minus the integral of x to the 21 e to the x except I picked up the 22 here. The pattern should be clear now every time I integrate by parts I pick up a new term like this and I get another integral with something lower. In fact, in general rather than just doing this let's write it a reduction formula let's not do it let's not do it for any particular number let's do it for n. So again if I integrate by parts du is nx to the n minus 1 dx v is e to the x so v is e to the x so this is x to the n e to the x minus the integral of n times x to the n minus 1 dx and now we just reply this over and over and over again to c and just keep doing it I can see that in fact the integral of x to the 23rd e to the x is going to be so I get an x to the 23rd e to the x and I lose a 23x to the 22 e to the x and then I have this integral which is going to give me a factor of 23 and so there's an integral in here that I'm not writing and that's going to give me a 22x to the 21 e to the x and then there's going to be another integral in here which I'm not going to write and I'm going to pick up a factor n n minus 1 n minus 2 and the signs are going to alternate all the way down to the bottom so that means that when am I going to get x to the 23rd let me just put the e to the x in the front I'm always going to get e to the x x to the 23rd then I'm going to lose a 23 x to the 22nd then I'm going to gain 23 times 22 x to the 21st then I'm going to lose 23 times 22 times 21 x to the 20th 22 times 21 times 20 x to the 19th and so on until I finally get down to 23 times 22 let me just write 23 factor I'm using the x I'm going to write 23 factor at least 23 times 22 times 21 times so what's the point of this sometimes it's easier just to make a formula and then use the formula over and over and over I do not recommend that you memorize this formula because it's really easy to derive and it's also really easy to mess up in your memory that maybe this should be a plus or maybe this is where the n goes or whatever so it's really not to your benefit except when you're using it to memorize such a formula and there are certainly programs that use formulas for you and they just use these formulas and the viewers are very good at looking up information on the fly okay so one last thing to say is that I didn't do depth in I'll do that first thing there is another homework assignment to do a web assignment on Wednesday there's also a paper homework assignment class which is due to the second presentation of this week it counts it's hard to show you that