Stony Brook MAT 126 Spring 2016
Lecture 02: Antiderivatives and Riemann Sums
January 27, 2016

Start   5x-8 + (12/x) now you want to do the antiderivative, now its much easier to do the antiderivative right?
because now you say well, what was the rule we learned last time?
this is 5x to the 1 so, add 1 to the power, divide by the new power you get 5x^2 over 2 8 just becomes 8x
0:34because the derivative of 8x is 8 and 12/x its slightly annoying-you have to put absolute value in the x plus c you could have one that looks like that
1:00for example lets do another type..ill let you guys copy that down for a few seconds
1:30oh well, okay because you can only take the natural log of a positive number however, here when you have 12/x its possible x is a negative number because unless you know that the domain has been restricted, which you dont you say well im not sure, so just to play it safe the natural log of the absolute value other than that i wouldnt worry too much about it when we do the integrals when you do something over x you need to write it as log of the absolute value of x
2:02because when youre evaluating the integral youre going to want to make sure that what you put it in, you put in as positive so if we have it and you say find it at -4 you do the log of positive 4 so its really just about getting the domain right
2:31student asks question sure you do x to the -1 now. when you add 1 to -1 what do you get?
so you get x^0/0 so this puzzled math people for awhile until they invented the math for log essentially because they said this doesnt make any sense its actually not really mathematically true but its good enough
3:32okay, let see if you can do that i'll give you a few minutes okay, so our original function our antiderivative must be..well the antiderivative of 3x^2.. is 3x^3/3 well this one is just plain old x^3 and whenever you do something like that
4:01you can always double check take the derivative of x^3 you get 3x^2 thats what we want the antiderivative of cosx is sinx because the derivative of sinx is cosx plus a constant so far so good?
and we know that f of 0 is 8 so 8... has to equal 0^3 + sin(0) + c well 0^3 is 0 and sin of 0 is 0
4:3050/50 guess right? because 0/1 and know. try to memorize those at some point therefore c is 8 i have a list of all the functions and their derivatives functions and their antiderivatives unit circle stuff..its all up on the instagram okay so if you look on there, its there theres some other fun pictures but if you look through, theres some math stuff on there
5:03and i'll put this stuff up on blackboard and before the exam i'll make a review sheet and all that stuff for you guys okay?
and there will be a practice exam and i will have a review session i think usually the class before is a review session
5:34alright so the function is... x^3 +sinx+ 8 how'd we do?
good? alright now, other stuff you can do.. is you can do a word problem kind of thing for those of you who remember-have any of you taken physics in high school?
you must have taken physics, okay you havent taken physics in college yet though
6:04generally you want to have this course before you take freshman physics although physics in the life sciences is not as important and believe it or not, physics is actually very useful for chemistry but for some weird reason we do chemistry first then you'll sit in physics class and be like hey i learned this in chemistry its really the other way around but you know, gotta do what you gotta do, the advisors are in control 1 of the things in physics is remember..
6:31there position, theres velocity, and theres acceleration so position-where you are at any moment velocity-how fast youre moving or in other words what your position is changing and acceleration-how fast your velocity is changing so youre in the car and youre going 40 mph thats your velocity if you step on the accelerator, you go from 40 to faster except not at a yellow light on nesconset because then it turns red and what happens camera, ticket, 85 bucks
7:04personal story
7:36so we can do stuff with position, velocity and acceleration and heres the fun part the derivative of position so position is usually given as x of t thats your location x at time t the derivative of x is your velocity
8:06if you have a position equation which says.. you want to find out where i am at a time plug in this equation and the velocity which remember, derivatives change velocity tells how fast your position is changing so thats the first derivative then you want to know how fast my velocity is changing you know, gas pedal thats the second derivative for the derivative of velocity
8:31also known as acceleration but of course, we can also work backwards what happens is i could give you the acceleration and now i could say find the velocity and find the position for example..
9:01sometimes instead of x we use a lowercase s the book may do that the book does do that it doesnt really matter you can use s, you can use x, you can use anything you want for position in physics they use s so we know the acceleration of this object is 3(t) +1 the velocity at time 0 is 6 and the position at time 0 is 24
9:32so lets find the equation for position so the other way is easy because you just take derivatives so now we do antiderivatives well, to find the velocity its going to be the antiderivative of 3t+1 so thats 3t^2 over 2 +t + c so check, take the derivative of 3t^2 and you get.. i mean 3t^2/2 and you get 3t
10:00take the derivative of t and you get 1 you take the derivative of the constant and you get 0 now we can solve for the constant because we know that the velocity at time 0 is 6 so when we plug in 0 you get a 0 here, a 0 there and you get c so, the velocity... is 3t^2/2 plus 6
10:34so far so good?
not very hard we could give you a harder one we could give you an e..sin... thats not really necessary
11:32so now if we know velocity lets find acceleration so the acceleration will be the antiderivative again so right now i have 3t^2/2 remember its really just 3/2(t^2) so for 3t^2/2 im gonna have 3/2(3t^3/3)
12:03then t will become t^2/2 6 will become 6t plus a new c which we call c again if you want-yes?
thats not a, youre right oh, you know what i meant
12:34so now we have another round of this we cancel these 3's and now we have t^3/2, t^2/2, blah blah blah okay so once again we know that the position at 0 is 24 so these are all 0 plus c so c is 24
13:00so your position equation.. is.. t^3/2+t^2/2+6t+24 so then if you want to make it sort of a test question you say whats the position at time 1 and now you have to plug in 1 so you think you're done but you have another step that sound good?
14:04so if a(t) is sin(t) + cos(t) now we're going to find the v(t) so we're going to do the antiderivative the antiderivative of sin is minus cosine because the derivative of cosine is minus sin so the derivative of minus cosine is positive sin the antiderivative of cosine is sin plus a constant
14:34so far so good?
we know that v at 0 is 1 so 1 is negative cosine of 0 plus sin of 0 plus c cosine of 0 is also 1 sin of 0 is 0, cosine of 0 is 1 so c is 2
15:01some of you are going to mess that part up because youre not going to plug in youre just going to sort of assume things are 0 when they arent so be careful thats one of the places where you mess up easily on the exams sin of 0...0 cosine 0...1 so that means now.. that v(t) is -cos(t) plus sin(t)
15:30plus 2 alright, now lets find x(t) so whats the antiderivative of minus cosine?
minus sin the derivative of sin is cosine the derivative of minus sin is minus cosine the antiderivative of sin is negative cosine and if youre not sure take the derivative the derivative of this is minus cosine
16:02the derivative of cosine is -sin the derivative of -cosine is plus sin the derivative of 2t is 2 plus c how did we do on this part?
happy so far?
x at 0 has to equal 2 so the 2 is minus sin(0) which is 0 minus cosine of 0 negative 1 plus 2x0 which is 0
16:30plus c 2... is 0-1+0+c so c is 3 and therefore... make sure to write that last line x(t) is...-sin(t)-cos(t)+2t+3 okay, howd we do on that?
17:16now were gonna actually do antiderivatives for real so, i will warn you in advance this is what most people consider some of the hardest stuff that we do because they have trouble with things like the notation
so we're going to now find we're going to do all sorts of cool integral stuff so weve been using the word antiderivative but really this is whats called integration integral calculus which is what calc b is all about we are now going to be doing... area under a curve which is 2 and 22
18:01so 2 is actually a pretty easy problem 22 on the other hand is something you might find not so easy i wont really get to that problem until monday
18:32area under a curve we know how to find simple areas because we learned that in school but suppose i wanted to find the area under something like that from here to there you might not know how to find that because its not one of the types of area thingys i ever learned but i know, say thats a and b then if i took this rectangle
19:01then the area underneath the curve is definitely more than that rectangle no doubt i also know that if i took this rectangle the area under the curve is definitely less than under that rectangle that rectangle is bigger than the whole curve right? because i got this.. that stuff is left over so the area is somewhere between those two rectangles does that make sense?
19:31so now lets get a little better lets just stick with underneath for the moment so i know the area is better than the area of that rectangle-bigger but i dont know how much so instead of 1 rectangle lets make 2 rectangles i kind of go like that well this one is still too small i got this stuff left over but this ones too big, i got some extra so its still not the area under the curve but im getting closer
20:03so what if i do 4 rectangles well now ive got.. these pieces which.. sorry that first rectangle underestimates its less than the area but this rectangle gets more than the area this rectangle gets more than the area
20:31this rectangle gets a little less than the area so were starting to get there i'm getting closer so if i add up enough rectangles i should get a pretty good approximation i could do 20 rectangles or 1,000 rectangles you know, you use a computer at that point but you certainly could take a bunch of rectangles and get the area so how do i come up with the area from each of these rectangles well, what i do is i pick my value on the x axis and you go to the next value on the x axis
21:01so lets just change those lets pretend the axis is 1, 2, 3, 4, 5 so the width of each rectangle here is 1 from 1 to 2, 2 to 3, 3 to 4, 4 to 5 okay?
so how do i find the height of the first rectangle?
well the height of the first rectangle is f of 1 its whatever you get when this curve is at best whatever you get when you plug in 1
21:31the value of the next rectangle is f(2) because its what you get when you plug in 2 the value of the next rectangle is f(3) the value of the next rectangle is f(4) so each time you get the height, i take my x value and take it up to the curve and that gets me the height of the rectangle and then i multiply the base times the height and that gets me the area of the rectangle so the area of these 4 rectangles would be the width of the first base is 1
22:01and the height.. is f(1) the width of the second one is 1 and the height is f(2) the width of the third one is 1 f(3) and 1.. and f(4) and now i evaluate the function and i get the area and id be close-not perfect but close
22:30alright so now for the f stuff lets do it with real numbers so lets find...
23:06now, LHR stands for left hand rectangle what do i mean by left hand rectangle?
so that means to find the height of each rectangle i go to the left side of each of these little intervals which we'll explain as we do it then we'll do it again with what i call right hand rectangles so youll see some of you may have seen this before most of you said you have not taken BC calculus so most of you have not seen this before correct?
23:31first time x^2+2 kind of looks like that where this is 2 and this is the curve f(x)=x^2+2 and we're going to go from here to there and you get 4
24:03thats 4 rectangles its a little slanted ill make that look prettier there you go, straighter
24:32so how do i get the width of each rectangle?
well the width of each rectangle is just 1 its the length from 2 to 1 from 3 to 2, 4 to 3 5 to 4 the height of the rectangle is found in the following way so i take each interval i take the interval from 1 to 2 i go to the left side of the interval, 1 and go up to the curve so that is f of 1 and i go across so notice.. the area of that rectangle
25:01will be just less than the area of the curve you see how its underestimated?
because the curve is here.. the edge of the rectangle stops there you get the second rectangle from 2 to 3 so the left side to 2 to 3 is 2 go up to the curve get the y value go across thats my second rectangle so again its underestimated when im all done the area is going to be less than the curve
25:32the next one i take the left side which is 3 go up to the curve, thats f(3) and thats the area and for the last one i take 4 and go across i get f(4) so what is the area? so the area is, i take the width which is
26:022-1 times the height, f(1) the next width.. is 3-2 notice these all come out 1 times f(2) the next width...right? width x height is 4-3 f(3) and the last one is.. 5-4
26:31f(4) okay so each of those widths is 1, thats easy and what is f(1)? well.. f(1) is 1^2+2 right?
and the next one is 1... times f(2) which is 2^2+2 and 1(3^2+2) and 1(4^2+2)
27:05that comes out.. 3+6+11+18 which is 38 k?
we understand that so far?
its going to get hard
27:30although the exam..we might give you a question thats not much different than this okay?
so when i do the exam this is normally what i test i might give you 6 rectangles just to punish you but thats it well what if i wanted id say its a good guess that the area under that curve is 38 so how can i make a better guess?
well, remember each of those rectangles is less than the area so i know its more than 38 right? because..
28:01i have this blank space left over everything okay so far? i see some puzzled faces so lets take.. well i could do right had rectangles so what would a right hand rectangle look like?
28:34same equation now if i want to find a rectangle 5 rectangles instead of using the left end of the interval we use the right end of the interval go up to 2 and go across and notice that area will be bigger than the area under that piece of the curve then from 2 to 3 i go up to 3 and across and again the area is bigger
29:00go up to 4 and across and its bigger then 5 and across so now im going to get more than the area under the curve so lets do it so the width of each of these again is 2-1 and 3-2 and 4-3 and 5-4 so each one is 1y the height of the first one i find by finding f(2) the right end of the interval
29:32and then 1[f(3)] 1[f(4)] and 1[f(5)] and what is f(2)?
f(2) is 2^2+2 we found that before and then 3^2+2 and 4^2+2 and 5^2+2
30:02that is 6+11+18+27 so that would be 62 so i know the area is somewhere between 38 and 62 whats a good way to guess?
average, yeah why not?
so whats halfway between 38 and 62?
so 50 is a good guess and in fact if you actually calculate the area its really close to 50 can we see where im getting the 50 from?
take 38 take 62, you add them together divide by 2 thats how you average 2 numbers right?
the other way you average 2 numbers you ask the person next to you, whats the average between the 2 numbers?
31:01that person gets to go to med school alright lets have you practice with another one like this before we do something harder if we just ask for left hand rectangles thats all you have to do so a typical test question left do right we'll do midpoints in a few minutes
31:30you know sometimes we say do it with 4 and we do it with 6 you can mix it up in a bunch of ways but basically we want to see if you understand the principle okay?
because then we're going to have you do it with an infinite number of rectangles just to keep you on your toes i know the infinite is the hard part but i think thats.. i think thats question 22 5.1 are we ready? you ready to try one?
32:44okay this should take you guys a couple minutes so do it twice do the four left hand rectangles do the four right hand rectangles this is just annoying its just the calculating thats annoying right?
33:01of course how do i make it harder? i give you fractions i go from 0 to 4 using 8 rectangles so now you have to do twice as much work and everything has halves in it or you do from 0 to 1 and you have like 7 so its like sevenths this is just evil lets start doin this one i could kind of use the same picture
33:37so 2x^2+3 again, you know, kind of looks like that. its a parabola when x is 0 you get 3 and then it kind of goes up it doesnt really look like that it looks more like that, but thats not very interesting you scale it or you unscale it and we're going from 0..
34:01to 4 so how wide is each rectangle?
1. how do we know?
well we're going from 0 to 4 thats a distance of 4 and we're dividing by 4 so the width of each one is 4-0, thats the endpoint right thats the length of the interval divided by the 4 rectangles remember this when it gets more interesting and if i want to do left hand rectangles
34:32the first one i have the width of 1 and the height is f(0) the next one has a width of 1 and the height is f(1) the next has a width of 1 and the height is f(2) and the last has a width of 1 and the height is f(3) okay?
35:02make sense so far?
thats the left hand rectangles and that should get you partial credit if you write that down now what is f(0)?
you plug in 0 you get 3 f(1) is 5 f(2) is 11 and f(3) is 21 how'd you do?
35:36so i got 40 you guys get 40?
40 for the south shore like massapequa alright now lets do it with right hand rectangles
36:07okay, so same picture okay, now the width of each of these is still 1 but the height of the first one is f(1)
36:30the height of the second one is f(2) if i go to the right hand side of this interval and i go up to there okay? thats f(2) begin the next one, right? for the right hand side?
and you go up, so each of these rectangles is overestimating and the last one would be f(4)
37:00so lets see i already found f(1) is 5 f(2) is 11 f(3) is 21 and f(4) is 35 72 right?
you got 72?
okay so then you could stop now if we said whats a good guess
37:31you would average 40 and 72 and you get 56 so far so good?
so 56 like i said is a pretty good guess if you do it its actually 55 and 2/3 or something like that so.. you get very close very fast when you average the 2 rectangles so what else could we do for the rectangle?
well instead of using the left side or the right side we could use the midpoint so suppose i wanted to do this with midpoints
38:04so if i had a midpoint then instead of finding f(0) or f(1) well now whats happening?
well now i find the area of the rectangle by going to the middle of each of these so notice what happens when you go to the middle part of the rectangle is above the curve
38:33and part of the rectangle is below the curve see that?
so one side is above and one side is below by the way these are curves that are going up when the curves are going down the right hand side gives you the lower estimate and the left hand side gives you a higher estimate of course the curve could go up and down so one is not always bigger and one is not always smaller so if i wanted to get the midpoints, well these are 1/2
39:023/2 5/2 and 7/2 the width of these rectangles is still 1 the height is f(1/2) plus 1.. at the 3/2 1.. at the 5/2 and 1 at the 7/2
39:30remember no calculators in MAT126 so f(1/2) is 7/2 f(3/2) is 15/2 correct me if im wrong f(5/2) is 31/2 and f(7/2) is 55/2 i think thats right
40:03and so you get 108/2 or 54 you just trust me on that?
you can use your calculators and make sure i didnt make a mistake and notice, thats not the same as adding the 2 and cutting it in half okay?
its not quite the same as halfway between the left and the right hand rectangles because the midpoint, because the piece thats above and the piece thats below are not
40:30exactly the same size so thats why its not the same as averaging the left and the right how do you feel about these so far?
do you love them?
so how can i make it a little harder?
i kind of have to make it harder because you know thats my job
41:15i make it harder by doing things that make them as infinite
41:48lets just work on the notation so everyone understands the notation i think thats the hard part the infinite part is actually kind of easy
42:07okay so you imagine you have your curve it doesnt matter what the curve looks like okay? and youre gonna start here and youre going to finish here and you have an infinite number one of these okay not just to have 1 or 2 or 3 of them you have a lot of them so how would you do that?
42:30well first lets just do n of them lets not worry about an infinite number for the moment so how wide would each of these be?
well if theres n of them then the width of each one is (b-a)/n okay?
so lets do this so lets say this was from 2.. to 10... and there were 6 of them right? well id say the distance from 10 to 2 is is 10-2 and you divide it by 6
so if theres.. n of them id say the distance from a to b is b-a divided by n so thats how the width would be to (b-a)/n so far so good?
alright now for the hard part the first location is a so the first one is going to be (b-a)/n f(a) the second one is going to have the width of (b-a)/n again
43:32and.. so where is this? well this is i went to a and i moved (b-a)/n to the right because thats how wide the interval is then the next one the width is still (b-a)/n
44:02and i took a and i moved (b-a)/n and another (b-a)/n remember (b-a)/n is how wide each rectangle is so i have 2 (b-a)/n's the next one i have 3 (b-a)/n's
44:31so whos lost?
lots of you id be lost. okay, so again the width of each rectangle its the distance b-a thats the whole length divided by n because theres n rectangles so if i have 100 rectangles i would take however far it is from b-a and divide it by 100 then the first spot on the left is a then to get to the next spot 1 rectangle width
45:01and the width is (b-a)/n then the next one i move from there another (b-a)/n to the right so i move 2 (b-a)/n's and to get to the next one i move 3 (b-a)/n's and i keep doing that dot dot dot until i get to the last one okay so how many of these do i do?
45:31do i do n of these?
not quite its a total of them but i started from 0 of these so im going to finish it n-1 (b-a)/n why n-1?
well say i had 100 of these okay i would go from 0 to 99 that makes 100 rectangles because im starting on the left side so first i would have nothing and then i'd add 1 width i'd add 2 widths
and its 0 widths, 1 width, 2 widths up to, if it was 100, up to 99 because then id have 100 of these so if i went up to n if i had n of these i would go up to n-1 does that make sense?
okay so thats one form of the notation now that notation is really not pretty so we can make that a little more compact
46:38instead of calling this (b-a)/n yes?
student asks question this is left hand all left hand okay?
how do i change this to right hand?
right hand, i start with the second one and instead of finishing at n-1 times (b-a)/n id finish at n times (b-a)/n
47:02which would be f(b) how do i make this more mathy, therefore more compact?
cause thats what mathematicians do
47:37no more a b stuff it starts at x(0) i finish at x(n) and i call the width of each of these rectangles delta x love that delta so the height well the width of each of these is delta x
48:00the height of the first is f(x0) the width of the second one is delta x and then f(x1) and delta x f(x2) and i keep going till i get f(x) - delta x yes so x is x, so n-1
48:33does that notation make sense to people?
we have to make sure you can process that so each one of these is the width of delta x whatever delta x is how do you find delta x delta x is (b-a)/n this is the most theoretical part of the course the most abstract is what we're doing in these couple of classes then it gets kind of less abstract and more concrete
49:00certainly hope so so b-a or just the endpoints so what youre doing their area from a to b n is how many rectangles you want and delta x is just b-a divided by n and the height of these-well if youre doing the left hand rectangles you start at x(0) and you finish at the next to last one because the next to last one
49:31starts at x of n minus 1 and finishes at x of n if i wanted to do right hand rectangles i would start at x of 1 and i would finish at x of n
50:07so another thing i could do is i could factor out the delta x so, left hand rectangles
50:30delta x times.. f(x0) + f(x1) + f(x2) + dot dot dot + f(x of n-1) and then the right hand rectangles is delta x f(x1)
51:01f(x2) f(x3) f(xn) so far so good?
so i'll have the video up and by the way i dont yet know exactly where the videos will be but we upload them and then professor tomaso will create a place on the webpage he may already have done that
51:31and it'll be something that says something about the videos you'll click on that and then the videos will be connected to the course she just has to get around to doing something called a php script any of you computer science majors know what that it?
yeah i have no idea but apparently shes really good at this stuff her webpage looks like this mine looks like crayons and like a kidnappers ransom note now one more thing we can do to make this really compact
52:02ready? sigma x or n y=0 n-1 of f of x sub i you guys want to know what the sigma means the sigma literally means do this ok?
sigma states the sum and these, start at the bottom number plug it in for i keep going keep incrementing this by 1
52:31stop when you get to n-1 and add them all up so plug in 0 plug in 1 plug in 2 until you get to x of n-1 if you want to do right hand rectangles it'd be sigma i= 1 to n of f(x sub i) do you see the difference?
this one goes from 0 to n-1
53:00this one goes from 1 to n and it says just literally plug in for i and add them up so these two are exactly the same sigma is just a smaller and more compact and mathy way of writing this do this at parties it really impresses the ladys-yes?
student asks question thats an i so this says i=0 to n, f(x sub i)
53:31kind of hard to write down here i should have a child just sit down here and write this you wouldnt notice a handwriting difference i know its not really that bad ok?
i think you've all had enough for one day-question?
student asks question *inaudible*