the next uh integration technique we're going to cover is called integration by parts this one is also very useful it's a little more involved than u-substitution and basically as u-substitution kind of goes with the chain rule uh for differentiation integration by parts you actually get from the product rule so before introducing um how integration by parts works i'm going to kind of derive the the formula here so i'm going to write this kind of a little strangely so imagine u and v are functions uh and so if u and v are functions um then i'm going to take their derivative and it's u times v so i'm going to use the product rule so the derivative of u times v is u times the derivative of the second which i'll write as dv plus the derivative of the first namely u times v okay so this is kind of a weird way to write the product rule but remember sometimes we write d a thing to mean the derivative of that thing so if the derivative of this guy is this that means that the integral of the right hand side is uv so let's write that and obviously because this integral is a sum i can split it up as two different integrals and then i'll just bring this integral over to the other side and actually i'll switch sides as well so i get the integral of u dv equals this uv minus the integral of v d u okay so this looks a little strange by the way you don't need to remember how this rule is obtained i just kind of wanted to show how it comes from the product rule but really what happens is you're looking to solve this integral here and so you have to identify a function u and a function's derivative dv so usually the way we do it is we write it as u equals and dv equals and then we have to find du right that's the other thing contained in this formula so du will be the derivative of u and now this can be a little confusing v is by definition the antiderivative of dv okay so this looks a little complicated but really the thing to keep in mind is if you use this formula you can write the integral of udv as this right hand side the only kind of sticking point is that even if the formula works keep in mind you get another integral back at the end so if this integral vdu that you get back at the end isn't somehow better simpler or more easy to do then you really haven't helped yourself okay so i realize this is pretty abstract let's do a concrete example and i think it'll become a little clearer so let's look at this guy so this is the integral of x times sine x i'm going to actually write the parts formula sort of lower here so remember the parts formula says that the integral of u times dv equals uv minus the integral of v times du okay and so obviously to apply this formula what i need is i need to figure out what u and dv each are in this first integral here and then i'll take the derivative of u to get d u and the antiderivative of dv to get v and um usually we with the derivatives we keep the dx with them so there'll be a dx in in each of d u and dv okay so i'm just going to try something and we'll see if it works so let me make a sine x my u and then keep in mind d u will be cosine x dx okay so what's left over um sorry there's kind of a split here what's left over is x dx so that'll be my dv and then remember to get v i anti-differentiate so i get x squared over 2. all right great so let's use this formula so before applying the formula let's just make sure everyone's on the same page so u is this sine x and then dv is this x well really x dx um and so i've split up the integral as u times dv just like down here and so this says that uh this integral equals u times v minus the integral of v d u so what's u times v well u is sine x v is x squared over 2. so u times v is x squared over 2 sine x minus the integral of v d u well vdu is x squared over 2 and d u is cosine x dx okay great so we've applied the formula correctly um i claim that we did everything right but our choice of u and dv was not right so why is that well if you think about it the integral we got back here so our first integral was x sine x the integral we got back was x squared cosine x over two but that doesn't really matter for how hard an integral is so if you think about it we've actually kind of made this worse for ourselves right we've made this worse because here our problem was an x and now here our problem is an x squared right so this integral that we got back from using the formula is actually worse than the one we started with so even though we use the parts formula correctly we're no closer to coming up with an answer for the integral let's do the same integral only with different choices for u and dv okay so here i have the same integral but i'm going to make my u equal to x and then my du will just be dx and so my dv has to be what's left over which is sine x meaning my v is the antiderivative of sine x which is negative cosine x okay so again using this formula here so i have my integral is u times dv and so this is equal to the product of u and v so u is x v is negative cosine x so i have negative x cosine x minus the integral of v times d u all right well v is negative cosine x so the negative just makes that a positive there and then d u is just dx so notice that even before even before kind of plugging in this formula we should have known that this would be better than our last attempt so why is that well keep in mind what shows up in this second integral is vdu and the reason that x is the correct choice for you is because x gets simpler as i differentiate it right i differentiated x i got 1 so the integral i got back was simpler than the one i started with if you think about our last attempt we chose u to be sine x differentiated got cosine x in terms of obviously those are not the same but in terms of difficulty they're kind of the same right sine and cosine are equally equally difficult to integrate but when we anti-differentiated x we got x squared over 2 which is worse okay so this is definitely much better let me just go ahead and integrate this so i have negative x cosine x and the integral of cosine is positive sine so plus sine x plus c all right great okay let's do another one of these so how about x e to the x this looks pretty similar to the one we just did and actually we can use the lesson we learned from the one we just did to pick our u and dv for this so keep in mind if i pick e to the x for either u or dv if i differentiate or anti-differentiate i'll just get back e to the x so e to the x doesn't really or doesn't change at all through differentiation or anti-differentiation however x gets simpler if i differentiate it just like in the last one so if you think about it for a second that means that the correct choice has to be x for u and e to the x for dv i differentiate x to get d u i get dx differentiate or antidifferentiate e to the x to get e to the x and so now i just use the formula um let me write the formula one more time it's u times integral of u times dv equals uv minus the integral of v to u one way to remember this you know if you forget this formula and you don't have it written down anywhere one easy way to remember this is keep in mind that d u and d v both have d x's in them and d x's make no sense outside of an integral right there they only exist in an integral so that's why the part that's outside of an integral has to be u times v because everything else has a d x in it and then the second integral you get back is sort of the reverse of the first integral right the first integral is u times dv second integral is v times du okay all right but we do have the formula here so let's just apply it so it's u times v so u is x v is e to the x minus the integral of v times d u v is e to the x d u is just dx that's a pretty quick integral to do so i get x e to the x minus e to the x plus c all right great for this one um let's kind of stick to the same idea so i won't write the formula up here because hopefully we're getting a little used to it so i'll make my u t squared and then d u is 2t dt and my dv will be cosine t dt and so my v is just sine t the antiderivative of cosine is sine all right so i get u times v so t squared sine t minus the integral of v d u which is 2t sine t dt okay so at first glance you might say well wait a second we're not any closer to solving this because look at what we got we have another integral that's kind of difficult to do but if you think about it for a second i can do parts on this integral again right because notice what happened you know what makes this a difficult integral is you have a variable to some power times a trig function so here i have t squared times cosine and even though this next integral is not immediate i did simplify it because instead of t squared i have just a t so if i do parts one more time on just this integral then um then i'll be able to solve the whole thing uh i think you know to avoid confusion it helps just to do the integral totally separately so i'm going to stop writing this first problem and i'll just treat this as if this were my new integral to do and this looks except for the 2t except for the 2 in front of the 2t this looks almost exactly like the first one we did but let's go ahead and do it anyway so i'll choose my u to be 2t my dv to be sine t dt then my du is two dt and my v is negative cosine t right the anti-derivative of sine is negative sine and so this integral becomes u times v so negative 2 t cosine t minus the integral of v d u is plus the integral 2 cosine t because this negative sign here made it plus dt okay and so i get back negative 2t cosine t plus the antiderivative of 2 cosine t is 2 sine t 2 sine t all right and now we have to be careful i'm going to plug this answer in for this integral here so my original integral that i'm trying to solve for has has as its anti-derivative t squared sine t minus this thing okay so t squared sine t minus i have to be careful minus 2t cosine t plus 2 sine t all right and i want to probably distribute this negative sign here so i get t squared sine t plus 2t cosine t and then minus 2 sine t plus c okay great so not so bad but this is where being comfortable with the uh being comfortable with the formula and kind of the way a parts problem works really helps because you know if you have to do it twice and you're not familiar with it i think it can get a pretty confusing just from the algebra you know just making sure you put kind of the right negative signs in and everything like that okay let's do another one so this one looks a little weird because you know parts were given the formula as u times dv but here it really looks like there's only one thing right and in fact it's kind of amazing um up to this point we don't really have an integral for natural log x right it's you know uh it's not like ln x is the derivative of one of the other basic functions or something like that so let's try to do this with parts and we'll see that our choices for what u and dv are are kind of limited so well what can my choice for dv be well i don't know the integral for natural log x if i made dv l and x i'd have to anti-differentiate it that would kind of defeat the purpose so i'll just make u ln x and that means that dv is just dx okay so d u i get by differentiating l and x which is one over x dx and then uh dv uh i anti-differentiate that to get v this looks a little weird but remember this is 1 times dx so the anti-derivative of 1 is just x okay great so let me use the formula so i get u times v so x natural log x minus the integral of v times d u so x times 1 over x dx but notice that this is just the x's cancel so this just gives me x natural log x minus the integral of dx right okay and so this is just x natural log x minus x plus c all right kind of amazing we didn't have you know the formula for the integral of natural log x before but this is how you get it just a parts argument that looks a little weird because again it's not like these two functions like x times e to the x or sine x or something like that okay to do the integral of arc tan x this actually looks pretty similar right um you know what we did with natural log x we said well we don't have a lot of choice for what u and dv are if we don't know the anti-derivative of ln x so let's do the same thing here so we want to split this up as u and dv well we don't know the anti-derivative of our tan x right that would be the uh that would be the answer to this integral which we don't know so we really have no choice but to make this arc tan x and then dv will just be dx okay so now i differentiate remember the derivative of arctan x is one over one plus x squared and the anti-derivative of dx is just x so i get back d or u times v so x times arc tan x minus the integral of v d u so you might be saying well you know this looks a little harder because right v we picked up an extra x but notice this is actually easier because if you look at what we have this is x on top of 1 plus x squared well the derivative of 1 plus x squared is just 2x so really this itself is a u substitution problem all right let's see if we can do this just via u substitution so we have x over 1 plus x squared all right so again this is not parts this is a u substitution so my inside function or the function whose derivative exists elsewhere in the integral will just be 1 plus x squared and then d u is 2x dx i don't have d u or i don't have 2x dx i have x dx so i'll divide both sides by two so i have one half d u equals x dx just to be clear i'm doing this integral totally separately and then i'll add it back into my formula for the answer for this integral all right so this is a different u as well because i'm doing this by a u substitution so let's see what i get so this 1 uh 1 over 1 plus x squared gives me 1 over u and then x dx becomes one half d u all right this is not a bad integral to do it's just natural log absolute value u so i have one half natural log absolute value u but i obviously have to plug back in for x so it's one half natural log absolute value one plus x squared but keep in mind that one plus x squared can't be negative so i really can just write it like this all right so this is this integral which showed up in our parts so now i'll just plug that in so i have x arc tan x minus one half natural log times one plus x squared plus c all right kind of amazing we could do this integral using parts and using a u substitution at the end because i think you know just given this is an integral right this is an inverse trig function so it's pretty hard to kind of say how you'd find an anti-derivative for that so this one may not initially look like an integration by parts problem because maybe you know there's kind of a u substitution to do but one thing we've seen is if we can think ahead to that other integral that we get when we apply the parts formula doing that will tell us that this integral we get back when applying this formula is probably okay in this case why is that well because i have an l and x i derive that i get 1 over x and then i also have x to some power in this case minus 3 i integrate that i get i get x to another power so it would seem like once i do the parts formula on this integral the integral i get back at the end of the parts formula is just going to be x to some power times x to some power and obviously that's an easy integral to do so you know when you get more comfortable with parts problems that's kind of what you start doing you say okay i'm going to look ahead to that integral at the end and see if i can get a tractable integral once i apply the formula okay so i'll go ahead and pick my u and dv so as we said if i derive ln x i just get x to some power namely x to the minus 1. so d u is 1 over x dx and then dv is 1 over x cubed which is the same thing as x to the minus 3 dx i integrate that that means i add 1 to the exponent divide by the new exponent okay so let's apply the parts formula here so first i get u times v uh v is uh negative x to the minus two over two so i can write this times i u as negative ln x over two x squared and then minus the integral of v times d u okay so i get v which is uh some sometimes i think it's easier to write them with a positive exponents so it's negative that makes this positive 1 over 2 x squared and then times d u which is times 1 over x dx okay and the good news is this is an integral that we can definitely do so this integral is just one half bring the one half outside and then x to the minus three we actually kind of did that integral already right here when we considered x to the minus three as our dv i'll write my dx as well so just doing this integral i add one to the exponent so i get x to the minus 2 divide by the new exponent so i get negative 1 4 and then i just plug this back into this integral so i'll write my full answer down here i have my u and v which obviously you don't need to do anything else with so negative ln x over 2x squared plus this integral and notice it's very easy to get mixed up with signs and stuff remember this integral was made positive by the fact that my v had a negative sign in it but then after i integrated i also got a negative sign so it's minus 1 over 4 x squared plus c okay so again not so bad um but it's just important to you know get the formula right obviously and not uh mix up the signs or anything especially when you're doing the integral you get back from the parts formula the last problem i'd like to do is sort of a weird kind of application of integration by parts called a circular integral so um what i'm going to do i'm going to set u equal to sine x and dv equal to e to the x dx all right so i get d u is cosine x dx and v is obviously just e to the x and so we'll plug this into the formula so i have e to the x times sine x minus the integral of vdu which is e to the x cosine x dx okay this looks a little weird because again right we have an integral that looks almost like the integral we started with the only difference is there's a cosine instead of a sine okay well let's do this integral separately and let's use parts again so again i'll pick u to be the trig function just like i did with the first integral and then dv will be e to the x dx so here d u is negative sine x dx and v is just e to the x and so what i get for this integral is e to the x cosine x minus the integral of v d u so it's minus a minus so it's plus the integral of e to the x sine x okay so now this looks weird because once i put all this together i'll have the integral of e to the x sine x appearing twice right i got back the integral that i started with so i'm gonna do this on a uh on a new slide but basically all i'm gonna do is i'm going to take this formula here which has the integral for e to the x cosine x in it and i found out what the integral for e to the x cosine x is it's this so i'm just going to substitute in this formula for the integral of e to the x cosine x okay so here's that integral with the second integral the e to the x cosine x integral uh subbed in for and so let's actually look at what happens when i distribute this negative sign i get back e to the x sine x minus e to the x cosine x minus the integral of e to the x sine x dx okay so this looks a little strange because again i have this integral e to the x sine x dx appearing twice well if you think about it for a second this is just the thing we're solving for so for instance if i had so this is a totally unrelated equation if i were solving for z in the equation z equals five minus z what would i do i would bring this z over to the other side and i would get 2z equals 5 and i divide by 2 right because z is what i'm solving for same exact thing here actually what you're doing is you're solving for this integral so think of this integral as just a variable for what you're solving so just like in this equation with the z's i bring this z over to the other side so i'm going to bring this copy of the integral of e to the x sine x over the other side and so i get 2 times that integral so 2 times the integral e to the x sine x equals what's left on the other side namely e to the x and actually i can factor out an e to the x to make it look a little nicer e to the x times sine x minus cosine x all right how do i solve for this integral i just divide by two and then of course since it's an indefinite integral we add c so this is definitely weird because it feels like we never actually got to the end of this chain of integrals right but what we did was we got the first integral back and this is an equation that's true so that means that if we're solving for this integral e to the x sine x dx we can just solve for it the same way we solve for z in this equation right um for this reason this type of integral which usually involves a trig function or definitely an exponential is called a circular integral right we start with an integral we get a different one back we do something again we get the same first integral back and then we're able to solve uh just using algebra so it definitely feels a little weird but again with some practice it's it's really not so bad