Stony Brook MAT 126 Spring 2016
Lecture 09: Integration by Parts
February 24, 2016

Start   break that apart then you figured this out right?
and this is uhh 5x from 0 to 2.
which is 10-0 which is 10.
hopefully it came out 0.
if i remember correctly but its memory so i could be wrong.
okay because i think g(x) was 5 cause you got that by doing the integral from 0 to 1 plus the integral from 1 to 2
0:30plus the integral from 2 to 3 thats how you found the integral from 0 to 2 okay?
this one okay so how do you do the derivative of an integral?
1:01first you'll plug the top function in so you'll get tangent of the ln(x^5)^2 times 5x^4 dont forget that part minus.. tan(ln2x)^2x2 ok?
really could have left it like that you dont really have to simplify.
but if you want to simplify
1:46you could do that dont do more than that dont show off your algebra.
many of you in the act of simplifying take a right answer and turn it into a wrong answer.
this makes it simpler for us to grade.
2:00dont simplify if you dont have to okay?
professor T and i have the same philosophy which is this is good enough.
that you know what youre doing.
howd you like that second one the trigonometry one did you guys figure that out?
wasnt that kind of fun?
wasnt that hard.
the answer to that was sinx i believe.
plus c of course.
2:47alright for those of you who thought this was trigonometry i wrote this question so
3:031-cos^2x is sin^2x right?
this is sin^2x.
so its going to cancel the sin^2x in the numerator.
and just leave you with dx/secx.
but wait sec in the denominator is cos in the numerator.
so this equals sinx+c.
there you go alright?
3:49this is the good stuff.
we're going to learn how to integrate so for a lot of the next oh handful of classes we do whats called technique of integration.
so this is the
4:02when you become physicists youre going to be really happy that you learned this.
suppose you do not become physicists then you say why am i learning techniques of integration?
well whats going to happen is physics computational biology, engineering economics statistics finance couple other areas you set up a problem, often you have to solve an integral because you figured something out, integrals are used to sum things.
4:32like we just did all those riemann sums right?
so integrals among other things is just a way of adding up a lot of stuff.
you want to add up a lot of stuff and the equation, you integrate it that gives you the sum.
okay? riemann sum is back umm so you'll set it up, and then you look at the integral and you say i have no idea what the solution is.
if it was derivative you could take the derivative but unfortunately you can differentiate just about anything but you cannot integrate just about anything.
lots of things cant be integrated.
5:02its kind of like you smashed it but you cant always put them back together.
so um youll be able to - but now we teach you how to integrate a variety of things.
so, in fact the plus c, just because you know if you have x^3 you could find the derivative as 3x^2 but if you know the derivative is 3x^2 you dont necessarily know that the original function is x^3.
theres lots of other functions it could be.
some things cannot be integrated. they are
5:31not integrable.
or theyre not, or theyre not very easily integrable.
and you learn as you move up into higher math how to get really good approximations.
like when you plug your answers into Wolfram Alpha as if we dont know about that okay wolfram alpha can give you an approximation as many digits long as you want.
it'll spit out 200 digits if you ask it to.
okay? and usually you dont need more than about 4.
so first major technique is something called integration by parts.
6:00remember product rule product rule says that if you have 2 functions multiplied together the u and the v okay the derivative of that u times the derivative of v plus v times the derivative of u to use a little shorthand.
udv+vdu so if we were to sorta integrate that
6:30you would get u times v the integral of udv + the integral of vdu.
so you do a little algebra and you can rewrite this as the integral of udv u times v minus the integral of vdu.
can all tell my u's from my v's?
u's have the little tail on them.
so that is our integration by parts formula.
so what'll happen is weve seen integrals now where you have a function and then you have a derivative inside the function and you say aha! chain rule.
well sometimes you'll have an integral where you have a function and you have another function multiplied together but you cant use the chain rule.
you cant use u substitution in other words.
so these will often have been the product rule.
so integration by parts
7:31works the product rule backwards.
this is a very powerful technique and you can often use this to solve lots of integrals.
one of the problems i tend to run into is once we teach you this you tend to try to use this on everything.
and you go into the exam and say lets do this with integration by parts doesnt work.
8:00i could do this one with integration by parts and that one doesnt work.
there are other techniques out there okay?
so dont just do integration by parts so far so good?
alright so how do we do one of these? well lets take a nice simple example.
suppose i ask you to do the integral of xcosx dx so you look at that and you say im gonna do u substitution.
the problem is if i make this u
8:30thats not sinx thats not the derivative.
if i make this u thats not 1 so thats not the derivative so i need something else.
what i do is identify a u and a dv.
and then im going to play with it a bit and use this formula.
so i look at this and i say lets let u=x.
dv=cosx dx.
9:01in other words inside the function i have something im going to differentiate and something im going to integrate.
now i take the derivative of u i get just dx..1dx.
and i take the antiderivative of dv remember thats really 1dv.
and i get sinx dx.
9:32so now my formula says the integral of xcosx dx is u times v x times sinx minus.. the integral of vdu which is sinx dx. that dx shouldnt have been there okay?
and now the integral of sinx is easy thats just -cosx.
10:01so this is xsinx+cosx dont forget the plus c.
okay? never forget that.
thats it, thats the solution.
of course so i look at this integral and i say one part of this im going to take the derivative of and one part take the antiderivative of.
so i say well lets let u=x ill tell you in a little why i chose that one.
10:33dv=cosx so im going to differentiate u and im going to get 1dx and you integrate cosx and i get sinx.
and now i go to my formula and it says the integral of udv so this is u and this is dv will equal u times v times the integral of v du.
so then i plug in i say well u times v is x times sinx and v du is sinxdx.
i integrate that and i get cosx.
how do i know this works? well lets take the derivative of this just to prove it.
lets do the check.
i have xsinx+cosx+ c and im going to take the derivative of that.
11:35so lets do the product rule because remember i dont want to end up with xcosx.
so if you said well what if its just xsinx? thats kind of what youre doing.
see the problem is if i take the derivative here i get xcosx thats what i wanted plus 1 times sinx with that annoying product rule.
but now if i take the derivative of cosx minus sinx
12:01and i get what i wanted cause thats inside the integral.
so thats how i know i got the right answer.
i got this and i checked it by taking the derivative and i say aha i got xcosx.
okay? we'll do a bunch of these dont worry so what the integration by parts does is it figures out the extra piece from the product rule and helps you subtract it off.
okay cause like i said i looked at xcosx
12:30i said what if the antiderivative is just xsinx?
it'll all be okay except when i take the derivative of xsinx i get this extra sinx piece.
so if i have a cosx here the derivative of that is -sinx then they subtract and i get what i want.
lets do another one so far so good?
im going to erase it in a minute so.
write it down, take a picture keep texting its all the same to me.
13:11so far so good?
do another one very similar.
suppose i was going to do xe^x.
13:42again, i look at u substitution i say thats not going to work.
because i dont have the function and its derivative inside.
i just have 2 different functions in there.
so if i let u=x
14:01du is dx.
cause thats the derivative of u.
alright the derivative of u, u is x, the derivative of u is dx.
dv would be e^xdx.
and whats the integral of e^x?
okay so use the formula.
14:30formula says that the integral of udv is u times v minus the integral of vdu professor bearnhart calls this the voodoo formula.
which the first time somebody said that to me i sort of said huh?
he said just do voodoo right?
i said im not quite sure what that is then i figured it out and i said yeah sure.
this says
15:00u=x, du=dx.
this dv=e^xdx.
v is e^x.
my handwriting is insulting.
very sad.
we dont love my handwriting?
its not that bad for a math geek right?
gets the job done.
so im plugging in parts u is x
15:31dv is e^x right?
so the integral of xe^xdx equals u times v so that would be xe^x minus.. the integral of vdu which is e^xdx.
alright now whats the integral of e^x?
so this is xe^x-e^x
16:02plus c.
im the one allergic to chalk dust i should be coughing and sneezing like crazy.
got the idea?
lets have you guys do another one but before we do that i just want to show you a very simple rule that will be very useful for everything we do going forward.
k if you have an integral of cosx right? we know thats just sinx.
16:30if you have a constant thats going to equal sin of kx divided by k.
youd get that if you used u substitution but you dont want to use u substitution on simple ones like this.
its going to drive you nuts.
so when you take the derivative of this right?
you would multiply by k so when you do the antiderivative you divide by k.
so for example if i had integral of sin(3x) it would be -cos(3x)
17:02divided by 3.
if thats true for cosine its true for sin.
its going to erase this useful for e.
by the way secant squared no sec^2
17:31those ones we dont really like you could have e^kx dx and that becomes e^kx/k plus the constant.
and one more thats very handy you have the integral of dx/ax+b thats going to be ln(ax+b)
18:01divded by a.
so its all sort of the opposite of derivatives which makes sense cause these are antiderivatives.
plus c.
told you when i was done with my exams i just put plus c next to everything.
just go back and check.
so you should memorize those because theyre very handy.
18:32so we could give you something slightly harder and youd be able to do it.
alright lets have you practice an integration by parts problem.
and the hardest part that people have with integration by parts other than just executing correctly if the minus signs.. and the fractions.
tend to mess that up.
19:00so you know what youre doing but you have a little trouble with the minuses and fractions cause youll see sometimes you need to do integration by parts more than once.
now take one very similar to the one we just did lets do the integral of xsin(3x)dx.
why doesnt everyone take 2 minutes and see if you can solve it.
19:30you need a functions derivative as a general rule if you have x to a power youre going to let that be the function.
and the other thing would be the derivative. so in other words you let u=x to the something and dv will be the other piece.
so itd be like u=the x dv would be sin(3x).. dx du..take this one integrate that.
20:00the derivative of x is 1dx.
antiderivative of sin(3x) is -cos(3x).
over 3, just taught you guys that.
cause you anti-differentiate, youre integrating, okay?
now we plug this in the formula.
formula is udv..integral of udv equals u times v minus the integral of vdu.
20:31so the integral of xsin(3x) dx is.. u times v so this times this -xcos(3x)/3.
minus... the integral of vdu but we have a minus so that equals plus the integral of cos(3x)/3dx
21:02remember i said watch your minus signs and watch your fractions.
so far so good?
now we just have to integrate this.
well this is just.. we still have cos3x over 3 is just 1/3 the integral of cos(3x) so thats 1/3
21:31times sin3x over 3.
also known as sin3x over 9.
so this becomes-i know plus c becomes -xcos3x/3 plus sin3x/9+c okay? so again
22:03you do, udv so u is x dv is sin3x.
derivative of x is 1 the antiderivative of sin is -cos3x/3.
now you go to your formula.
you have..minus.. xcos3x/3, thats the first part.
minus minus becomes plus the integral of cos3x/3.
22:30this integral well its 1/3cos3x so thats going to be 1/3sin3x/3 1/9sin3x.
k and you just put the whole thing together.
so whatll happen with integration by parts is you get these chains of functions because as i said you need the other terms to get rid of the problem terms from the product rule.
because you look at this and you say i want this to just be -xcos3x but its not that simple.
if we differentiated this
23:01you have a leftover term and this helps you get rid of the leftover term.
anybody get this one right?
some of you?
alright lets do another one.
gotta get good at this.
how about... the integral of x^2e^2x dx. now ill tell you that x^2 youre going to have to do integration by parts twice.
so let u=x^2 integration by parts, and then when youre done you have to do it a second time.
so lets let u=x^2
24:01and dv=e^2x dx.
then du will equal 2xdx.
v will equal e^2x/2.
in general when you have x to a power youll usually have e, sin or cos as the other term, usually.
24:31then x to the power will be your u term.
the main exception will be natural log.
if you have lnx thats always going to be your u term.
these are the types that you can count on.
okay so now we have the integral of x^2e^2x is.. u times v.
so x^2e^2x/2 minus.. the integral of vdu.
25:00which is the integral of e^2x/2 times 2x dx and those 2's cancel.
so you have x^2e^2x/2 minus the integral of xe^2xdx.
we just did the integral of xe^x right?
when it says do that just do integration by parts.
25:38now write u=x du will be dx.
dv is e^2xdx.
v is e^2x/2.
26:07so this now becomes x^2e^2x/2 minus.. be very careful about minus signs.
very easy to mess them up.
u times v is xe^2x/2.
26:32integral of e^2x/2 dx.
and you distribute the minus sign you get x^2e^2x/2 minus xe^2x/2.
plus 1/2 the integral of e^2x dx
27:02one more round now you can do integration by parts.
thats just a basic integral.
this becomes.. x^2e^2x/2 minus.. xe^2x/2.
plus e^2x so lets see this is over 2 and thats a half so over 4.
plus a constant.
27:32and if you differentiate that youll see how the product rule works.
so you take the derivative of this you have a leftover term from the product rule.
just gets rid of it but wait you take the derivative of this you have a leftover term from the product rule and this gets rid of it.
gotta do some more.
get you guys good at these.
28:00how much fun is this?
youll get good at these youll see.
e^x take you all night.
whered you get lost?
minus xe^2x minus minus becomes plus i just took the 2 out and thats a half and this is a minus this is a minus so thats a plus
28:31and this 2 becomes a half.
you have x^2e^2/2 minus this one minus minus becomes a plus the last one.
e^2x/2 is the same as a half e^2x.
thats what it means divided by 2 right?
k youre not happy.
lets do another one.
29:03by the way you could have like x^3, x^4, x^5 but we wouldnt do that of course theres a trick if you have high powers of x.
or a technique its not really a trick a shortcut.
okay, gotta do that one by parts.
29:33its bit of pain but we'll get there.
we have 2 other types to learn today.
remember this isnt u substitution.
dont confuse the u from the one with the u from the other.
just kept it the same letter.
30:06okay lets let u=x^2.
dv will be cos4x.
dx if the u=x^2 cause when i differentiate x^2 i get 2x.
when i differentiate again i get 2.
my problem gets better each time.
if i differentiate cos i just get sin if i differentiate sin i just get back to cos so im not really getting anywhere.
30:31so thats why you let u be the x^2 term.
if you do it the other way youll watch its just a mess.
alright now i let du =2x dx.
and v will be sin4x/4.
its always divided by this number.
so now this integral x^2cos4xdx becomes..
31:03the integral of u times v which is x^2sin4x/4.
minus the integral of vdu.
minus.. integral of 2xsin4x/4 dx.
and the 2 and the 4 cancel so i get this is x^2
31:33sin4x over 4 minus x-oops 2/4 is a half.
so take that out-minus a half integral of xsin4x dx.
so ive improved my integration by parts by going from x^2 to x.
so now i just do it again.
32:06so i let u=x dv..sin4xdx.
then du is dx.
v is -cos4x dx.
32:32no dx sorry.
so this integral-remember our original integral was x^2.. cos4xdx now equals x^2sin4x/4 minus a half this integral becomes -xcos4x
33:04minus minus minus minus integral of cos4x dx.
oh i forgot over 4 sorry thank you.
be careful with the minus signs okay?
33:32you have minus a half times this integral.
which is -xcos4x/4 minus..minus.. that becomes plus integral of cos4x/4 dx.
distribute. watch your halves.
watch your minus signs.
you get x^2sin4x/4
34:00plus an eighth.
of xcos4x minus an eighth the integral of cos4xdx.
and that is sin4x/4.
so we get x^2sin4x over 4 plus 1/8xcos4x.
34:32-1/8sin4x/4 it becomes sin4x/32 plus c so see how it goes 4, 8, 32?
youll see a lot of that kind of stuff.
that comes from all of the differentiating in product rule.
that was messy.
thats all one problem.
35:01grading these is really fun.
i hope you get partial credit.
not up to me.
yes of course youll get some partial credit.
i dont tend to assign anything harder than this because like i said its not fun to grade and also were really just testing peoples algebra skills at some point youre not testing calculus skills.
alright lets do an easier type
35:32but another one when i say easier i mean less algebraic.
you guys wanted to take even more calculus.
no want here. have to.
youre here because you must be here not because you wish to be here.
with a few exceptions.
36:04we know that the derivative of natural log is 1/x.
and the integral of 1/x is natural log.
but what do you think the integral of natural log is?
we kind of want that to be 1/x but its not.
its the other way around.
we do that with integration by parts.
let u =lnx
36:31dv, well whats dv equal to?
dv is just going to be dx.
its going to be 1, remember this is a 1 in here.
so dv is dx.
so when you differentiate this you get 1/xdx.
when you integrate this you get x.
so now i go to the formula
37:03and this is u times v which is xlnx minus the integral of v times du.
whats v times du?
x times 1/x.
and x and the 1/x cancel.
so this equals x times lnx
37:32times the integral of dx.
the integral of dx is just x.
the derivative of x is 1 remember this is its saying this is 1dx.
so this is x.. lnx minus x you may want to memorize that.
i memorized it.
i recommend you do.
38:03so the integral of log of x dx equals xlnx-x a handy one just to put in your memory bank.
38:30so far so good?
so far so good, alright.
one last one for today cause i know how much you love this.
this is one of the more interesting types.
we did the x times e^x the x times sinx the x^2 times e^x and all that stuff right? now.. slightly different one.
39:02what if i want to do the integral of.. e^xcosx dx these things show up a lot in electrical engineering.
and other places.
show up in physics.
lots of things that go like this you get the sines and cosines.
and if they dampen so if they go
39:30then you get an e term.
and so on so theres lots of phenomena that behave like these so you have to learn how to integrate them.
theyre not the only ones, just some of them alright.
lets do this one. lets let-well it doesnt really matter which one i pick see the problem is the derivative of e^x is e^x the integral of e^x is e^x so i dont see me getting anywhere.
but when i do sin and cosine it just kind of floats back and forth so how am i going to do this one? well lets see lets let u=e^x.
du is e^xdx.
v is sinx.
so now the integral of e^xcosx
40:30dx equals u times v which is e^xsinx minus the integral of vdu.
e^xsinx dx.
i havent really made my life easier have i? i just turned e^xcosx into e^xsinx.
but hang in there.
so i have to do this integral now
41:02so lets let u=e to the-nah ill put it over to the side.
dv equals sinx dx.
du will equal e^xdx.
and v will equal -cosx.
k be careful watch your minus signs.
41:32so im going to take this integral my original integral was e^xcosxdx.
and that equals e^xsinx minus, now i use the formula minus e^xcosx.
minus minus is plus.
integral of e^xcosx dx
42:00which is this equals e^xsinx + e^xcosx minus the integral of e^xcosxdx so now you say wait a second im back where i started.
i had e^xcosx and it turned it into e^xsinx and now im back to e^xcosx.
42:31this is a waste of time youre just going around in circles.
i dont understand, help!
so then you go-well wait.. this is a minus integral of e^xcosx.
so why dont i just add the integral back to the other side?
yes, you can do that.
what do you mean you can do that, im going to do it watch.
so now you get 2 integral e^xcosx dx
43:02equals.. e^xsinx +e^xcosx youre done.
wait what do you mean im done? youre done.
divide by 2 e^xcosxdx is e^xsinx +e^xcosx over 2 plus c-kind of seems like a cheat doesnt it?
43:32what it was you just put it back where you started and you ended up with the final answer.
said hey i have an integral on the left and i had no integral on the right so i must have done something correct.
so lets go through it again.
so you let u=e^x.
du is e^xdx.
dv is cosx and v is sinx so you get this integral.
then you repeat you get that.
here except now you have a minus the integral of e^xcosx.
so if i add it back to the other side i have e^xcosx
44:03plus another integral of e^xcosx which should be 2 integrals of e^xcosx.
then i just divide by 2.
took this integral right here.. took this integral right here and added it to the other side.
and yes youre allowed to do that.
alright ill see you monday.