Transcript

the following content is provided under a Creative Commons license your support will help MIT open courseware continue to offer highquality educational resources for free to make a donation or to view additional materials from hundreds of MIT courses visit MIT open courseware at ocw.mit.edu so we're going on to the third unit here so we're getting to started with unit three and uh this is our intro to uh integration which is basically this the second half of calculus after differentiation today what I'll talk about is what are known as definite integrals well uh actually it looks like our are we missing a bunch of overhead lights is there a reason for that let's see ah all right okay that's a little brighter now all right so the the idea of definite integrals is uh can be presented in a number of ways but I will be consistent with uh the rest of the presentation in the in the course we're going to start with the geometric point of view and the geometric point of view is the problem we want to solve is to find the area under a curve the other point of view that one can take and we'll mention that at the end of this lecture is the idea of a cumulative sum so keep keep that in mind that there's a there's a lot going on here uh and there many different interpretations of what the integral is now uh so let's let's draw a picture here I I'll start at a place a and end at a place B and I have some curve here and what I have in mind is uh to find this area here and of course in order to do that I need more information than just where we start and where we end I also need the bottom and the top by convention the bottom is the X AIS and the top is this the curve that we've specified which is yals f ofx and we have a notation for this which is of the the notation used in calculus for this as opposed to some geometric notation and that's uh the following expression it's called an integral but now it's going to have what are known as limits on it it'll start a and end at B and we write in the function f ofx DX so this is what's known as a definite integral and it's interpreted geometrically as the area under the curve the only difference between this collection of symbols and what we had before with indefinite integrals is that before we didn't specify where it started and where it ended now in order to understand what to do with this guy uh I'm going to just describe very very abstractly what we do and then carry out uh one example uh in in in detail so to compute this area we're going to follow uh initially three steps first of all we're going to divide into rectangles and unfortunately because it's impossible to divide a curvy region into rectangles we're going to cheat so they're only quote unquote rectangles they're almost rectangles and the second thing we're going to do is to add up the areas and the third thing we're going to do is to uh Rectify this problem that we didn't actually hit the answer on the nose that we were missing some pieces or or choosing some extra bits and the way we'll Rectify that is by taking the limit as the rectangles get thin infinitesimally thin very thin pictorially again that looks like this we have a and our B and we have our guy here this is our curve and I'm going to chop it up first I'm going to chop up the uh x axis into little increments and then I'm going to chop things up here and I'll decide on some rectangle maybe some staircase pattern here like this now I don't care so much uh in some cases the rectangles overshoot in some cases they're underneath so the new area that I'm adding up is is off it's not quite the same as the area under the curve it's it's got it's this region here but it includes these extra bits here and then it's missing this this little guy here this little bit there is missing and as I say these little pieces up here this little bit up here is extra all right so that's why they're they're we're not really dividing up the region into rectangles we're just taking rectangles and then the the idea is that as these get thinner and thinner the little itty bitty amounts that we missed by are going to zero and they're going to be negligible already you can see it's kind of a thin piece of area so we're not missing by much and as as these get thinner and thinner the problem goes away and we get the uh answer on the nose in the limit all right so here's our first example I'll take the first interesting curve which is uh f ofx is equal to x^2 I don't want to uh do anything more complicated than one example because this is a a real labor here what we're going to go through and to make things easy for myself I'm going to start at a equals z but in order to see what the pattern is I'm going to allow B to be arbitrary all right let's uh draw the graph and start breaking things up so here's the the parabola and there's this piece that we want which is going to stop at this place B here and the first step is to divide into uh n Pieces that means well graphically I'll just Mark the first three and maybe there are going to be many of them and then I'll draw some rectangles here and I'm going to choose to make the rectangles all the way from the right that is I'll make this staircase pattern here like this that's my choice I get to choose whatever level I want and I'm going to choose the right ends as the uh as the shape of the staircase so I'm overshooting with each rectangle and now I have to write down formulas for what these areas are now the there's one big advantage that rectangles have and this is the starting place which is that they're it's easy to find their areas all you need to know is the base and the height and you multiply and you get the area that's the reason why we can get started with rectangles and in this case these distances I'm assuming that they're all equal equally spaced intervals and I'll always be doing that and so the spacing the bases the base length is always B by n all equal intervals so that's the Bas length and next I need the Heights and in order to keep track of the Heights I'm going to draw a little table here with with X and F ofx and plug in a few values just to see what the pattern is the first place here uh after zero is B / n so here's B ID n that's an x value and the F ofx value is the height there and that's just I evaluate F ofx F ofx is X squ and that's B / uh and the quantity squared and similarly the next one is 2 B over n and the value here is 2 B over n the quantity squared right that's this this height here is is 2b ID n that's the second the second rectangle and I'll write down one more 3B Over N that's the third one and the height is 3B Over N the quantity squared and so forth well my next job is to add up these areas and I've already prepared that by finding out what the base and the height is so the total area or the sum of the areas let's say of these rectangles is um well the first one is BN * B / n^ 2 the second one is 2 B Over N I'm sorry is b/ n * 2 b/ N squared and it just keeps on going and the last one is B Over N time n b over n^ squ so it's very important to figure out what the uh general formula is and here we have a base and here we have a height and here we have the same kind of Base but we have a new height and and so forth and the pattern is that the coefficient here is one then two then three all the way up to n the rectangles are getting taller and taller and this one the last one is the biggest okay this is a very complicated Gadget and the first thing I want to do is simplify it and then I'm actually going to evaluate it but actually I'm not going to evaluate it exactly I'm just going to evaluate the limit turns out limits are always easier the point about calculus here is that these rectangles are hard but the limiting value is an easy value so what we're heading for is the simple formula as opposed to the complicated one all right so the uh the first thing I'm going to do is factor out all of these B Over N factors there's a b Over N here and there's a b Over N squ so all told we have a b over n the quantity cubed as a common factor and then the first term is one and the second term what's left over is 2^ squared 2^ squar and then the third term would be 3^ squ although I haven't written it and the last term there's an extra factor of N squared in the in the numerator okay is everybody with me here now what I'd like to do is to um what I'd like to do is to eventually take the limit as n goes to Infinity here and the quantity that's hard to understand is this massive quantity here and there's one change that I'd like to make but it's a a very modest one uh extremely minuscule which is that I'm going to write one just to see that there's a general pattern here I'm going to write one as one squared and well let's put in the three here why not and now I want to use a trick this trick is is is not completely recommended but I will I will say a lot more about that when we when we get through to the end I want to understand how big this quantity is so I'm going to use a a geometric trick to draw a picture of this quantity namely I'm going to build a pyramid and the base of the pyramid is going to be n byn blocks so imagine we're in Egypt and we're building a pyramid and the next layer is going to be nus1 by n minus1 so this next layer in is nus1 by n minus1 so the total number of blocks on the bottom layer is n SAR that's This this rightmost term here but the next term which I didn't write in but maybe I should the very the next to the last term was this one and that's the second layer that I've put on now this is the this is the if you like the top view but perhaps we should also think in terms of a side view so here's the same picture here's we're starting at n and we build up this layer here and now we're going to put a layer on top of it which is a little shorter so the first layer is of length n and the second layer is of length n minus1 and then on top of that we have something of length n minus 2 and so forth and we're going to pile them up so we pile them up all the way to the top which is just one one one giant block of stone and that's this last one one squared so we're going backwards in the sum and so we I have to build this whole thing up and I get all the way up in this staircase pattern to this top block up there all right so here's the trick that you can use to estimate the size of this and it's sufficient uh in the limit as n goes to Infinity the trick is that I can imagine the solid thing underneath the staircase like this that's a a an ordinary pyramid not a not a not a staircase pyramid which is which is inside and this one is inside and so but it's but it's an ordinary pyramid as opposed to a staircase pyramid and so we know the formula for the volume of that because we know the formula for volumes of cones and the formula for the volume of this guy of the inside um is uh 1/3 base time height and in that case the base here so that's 13 and the base is n byn right so the base is n s that's the base and the height it goes all the way to the top point so the height is n and what we've discovered here is that this whole sum is bigger than 13 n cubed now I claimed that this line by the way has slope two so you go half over each time you go up one that's why you get to the top on the other hand I can trap it on the outside too by drawing a par parallel line out here and this will go down a half more on this side and a half more on the other side so the base will be n + 1 by n + 1 of this bigger pyramid and it'll go up one Higher all right so on the other end we get that this is less than a thir n + 1 cubed again n + 1 2 * n + 1 again this is a a base times a height of this bigger pyramid yes question you're adding up areas with the white in in the center of your inequality and then equating it to volume um the question is it seems as if I'm adding up areas and equating it to volume but I'm actually creating volumes by making these on increments here that is the the the base is n but the height is one okay the the the the uh thank you for pointing that out each one of these little staircases here has exactly height one so I'm I'm honestly sticking blocks there they're sort of square blocks and I'm lining them up and I'm getting thinking of n byn cubes if you like honest cubes there and they're the height is one and the base is n s okay all right so I claim that I've trapped this guy in between two quantities here and now I'm ready to take the limit if you look at what our goal is we want to have an expression like this and I'm going to uh this was the massive expression that we had and actually I'm going to write it differently I'll write it as B Cubed * 1^ 2 + 2^ 2 + + n^ 2 / n cubed I'm going to combine all the n's together all right so the right thing to do is to divide what I had up there divide by n cubed in this in this uh uh set of inequalities there and what I get here is a thir is less than 1 + 2^ 2 + 3 2 + n^ 2 / n cubed is less than 1/3 * n + 1 cubed / n cubed and that's A3 * 1 + 1 n cubed and now I claim we're done because this is a third and the limit as n goes to Infinity of this quantity here is easily seen to be this is as n goes to Infinity this goes to zero so this also goes to a third and so our to Total here so our total area under X2 all right which we sometimes might write the integral from 0 to B x^2 DX is going to be equal to well it's this 1/3 that I've got but then there was also a B Cubed there so there's this extra B Cubed here so it's a third B Cubed that's the that's the result from this whole computation yes question so that a very good question the question is why did we leave the B Over N cubed out for this step and uh part of the answer is malice of forethought in other words we know what we're heading for um we know we understand this quantity it's uh all one thing this thing is a sum which is growing larger and larger it's not what's called a closed form so the thing that's not known or not well understood is how big is this quantity here 1^ s+ 2^ s the sum of the squares whereas this is something that's quite easy to understand so we Factor it out and we analyze carefully the the piece which we we don't know yet how big it is and we discover that it's very very similar to n cubed but it's more similar to 1/3 n Cub it's almost ident identical to 1/3 n cubed that this extra piece here so that's what's going on and then we match that since this thing is very similar to 1/3 n cubed we cancel the N cubes and we have our result all right let me just mention that although this may seem odd in fact this is what you always do if you analyze these kinds of sums you always factor out whatever you can and then you still are faced with a sum like this so you will this will happen systematically every time you're faced with such a sum okay now I want to say one more word about notation which is that this notation is an extreme nuisance here and it's really sort of too large for us to deal with and so uh mathematicians have a a shorthand for it unfortunately when you actually do a computation you're going to end up with with this collection of stuff anyway but I want to just show you the summation notation in order to compress it a little bit the idea of summation notation is the following following so this this thing tends uh the idea is the following I'll I'll I'll illustrate it with an example first so uh well the general notation is the sum of AI IAL 1 to n is a1+ A2 plus dot dot dot plus a n so this is the this is the abbreviation and this is a capital sigma and so this quantity here for instance is 1 n cubed * the sum i^ 2 I = 1 to n all right so that's that's what this thing is equal to and what we just showed is that that tends to 1/3 as n goes to Infinity all right so this is the this is the way the summation notation is is uh is used there's a formula for each of these coefficients each of these entries here or summands and then this is just an abbreviation for what the sum is and this is the reason why I stuck in that one squared at the beginning so that you could see that the pattern worked all the way down to I equals 1 it isn't an exception to the to the rule it's the same as all of the others now over here in this board we also had one of these extremely long sums and this one can be written in the following way and I hope you agree this is rather hard to scan but the the uh one way of writing it is it's the sum from I 1 to n of now I have to write down the formula for the general term which is b/ n * i b Over N SAR so that's a a way of abbreviating this massive formula into one which is just a lot shorter and now the manipulation that I performed with it which is to factor out this B Over N cubed is something that I'm perfectly well allowed to do also over here this is the distributive law this if I factor out B Cub Over N cubed I'm left with the sum I = 1 to n of i s all right so these notations make it a little bit more compact the uh what we're dealing with the the the conceptual phenomenon is still the same and the mess is really still just hiding under the rug but the notation is at least fits on on on a a few with a a few fewer symbols anyway all right so uh let's uh let's continue here I've given you one calculation and now I want to fit it into a pattern and here's the here's the the thing that I'd like to calculate so first of all let's try case so I'm going to do two more examples I'll do two more examples but they're going to be much much easier and then things are going to get much easier from now on so the second example is going to be the function f ofx is equal to X if I draw that that's this function here that's the line with slope one and here's B and so this area here is the same as the area of the triangle with with base B and height B so the area is equal to 12 B * B so this is the base and this is the height we also know how to find the area of triangles and so the formula is a half b squared and the third example notice by the way I didn't have to um do this elaborate summing to do that because we happen to know this area the third example is going to be even easier f ofx is equal to 1 by far the most important example um remarkably when you get to 1802 in multivariable calculus you will forget this calculation somehow and I don't know why but it's happens to everybody so so the function is just horizontal like this right it's the constant one and if we stop it at B then the area we're interested in is just this from 0 to B and we know that this is height one so this is area is um base which is B * 1 So it's b let's look now at the pattern we're going to look at the pattern of the function and it's the area under the curve which is this is has this elaborate formula in terms of so this is just the area under under the curve between uh zero and B and we have X SED which turned out to be B Cubed over 3 and we have X which turned out to be well let me write them over just a bit more to give myself some room X which turns out to be B ^2 / 2 and then we have one which turned out to be B so this I claim is suggestive uh if you can figure out the pattern one way of making it a little clearer is to see that X is X to the first Power and 1 is X to the 0o power so this is the case 0 1 and 2 and B is B to the 1 / 1 so if you want to guess what happens when F ofx is X cubed well if it's zero you do B the 1 over 1 if it's 1 you do B the 2 over two if it's two you do B the 3 over3 so it's reasonable to Guess that this should be B to 4 / 4 right that's that's a reasonable guess I would say right now the strange thing is that in history uh Archimedes uh figured out the area under a parabola so that was a long time ago it was after the pyramids and he used actually a much more complicated method than I just described here and his method which is just fantastically amazing was so brilliant that it may have set back mathematics by 2,000 years because people were so it was so difficult that people couldn't see this pattern and couldn't see that actually these kinds of calculations are easy so they couldn't get to the cubic and even when they got to the cubic they were struggling with everything else and it wasn't until calculus fit everything together that people were able to make serious progress on calculating these areas even though he was the expert on calculating areas and volumes for his time so this is really a great thing that we now can have easy methods of doing it and the main thing that I want to tell you is that we will not have to labor to build pyramids to calculate all of these quantities we will have have a way faster way of doing it this is the slow laborious way and we will be able to do it so easily that it will happen as fast as you differentiate so that's coming up tomorrow but I want you to know that it's going to be however we're going to go through just a little pain before we do it and I'll just tell you one more one more piece of notation here all right so you need to have a little practice just to recognize how how much savings we're going to make but never again will you have to face elaborate geometric arguments like this so let me just add a little bit of notation uh for the uh for for uh uh for definite integrals all right and this goes under the name of reman sums named after a a mathematician from the 1800s so this is the general procedure procedure for definite integrals we divide it up into pieces and how do we how do we do that well so here's our a and here's our here's our B and what we're going to do is break it up into little pieces and we're going to give a name to the increment and we're going to call that Delta X so we divide up into these so how many pieces are there if there are n Pieces then the general formula is always that Delta X is 1 / n * the total length so it has to be B minus a Over N we will always use these equal increments although you don't absolutely have to do it we will for these remon sums and now there's only one bit of flexibility in that we will allow ourselves which is this we're going to pick any height of f between uh in in the interval in each interval so what that means is let me just uh show it to you on the on the picture here is I just pick any value in between I'll call it CI which is in there and then I go up here and I have the level which is f of CI and that's the rectangle that I choose in other in the in the case that we did we always chose the right hand the large which turned out to be the largest one but I could have stuck chosen some level in between or even the leftand end which would have meant that the staircase would have been quite a bit lower all right so any of these staircases will work perfectly well so that means we're picking um f of CI and that's a height and now we're just going to add them all up and this is the sum of the areas of the rectangles because this is the height and this is the base this notation is supposed to be now very suggestive of the notation that uh that uh liet used which is that in the limit this becomes an integral from A to B of f ofx DX and notice that the Delta X gets replaced by a DX so this is what happens in the limit as the uh the rectangles get thin so that's as Delta X goes to zero and these these gadgets are called remon sums this is called a remon sum and we already worked out an example this very complicated guy was an example of a reman sum right so that's a notation and uh we'll give you a chance to get used to it a little more when we do some numerical work at the end all right now the last thing for today is I promised you an example uh which was not an area example I want to be able to show you that integrals are can be interpreted as cumulative sums integrals as cumulative sums so this is just an example and and uh so so here's the here's the way it goes so we're going to consider a function f we're going to we're going to consider a variable T which is time in years and we'll consider a function f of T which is in dollars per year all right this is a financial example here that's the unit here dollars per year and this is going to be a borrowing rate now the reason why I want to put units in here is to show you that uh there's a good reason for this strange DX which we append on these these integrals this notation it allows us to change variables allows us to be consistent with units and allows us to develop meaningful formulas which are which are consistent across the board and so I want to emphasize the units in this in this uh when I when I set up this modeling problem here now you're borrowing money let's say every day all right so that means delta T is 1 365 that's almost one over infinity from the point of view of various purposes all right so this is how much you're borrowing uh each in each time increment you're borrowing and let's say that you borrow your rate varies over the year I mean sometimes you need more money sometimes you need less certainly any business would be that way and so here you are you've got your money and you're borrowing it but the rate is varying and so how much did you borrow well uh in day um 45 which corresponds to T over 40 is 45 over 365 you borrowed the following amount here was your borrowing rate times this quantity so dollars per year and so this is if you like so I want to emphasize the scaling that comes about here you have you have dollars per year and this is um this is uh uh this number of years so that comes out to be in dollars this final amount this is the amount that you actually borrow so you borrow this amount and now if I want to add up how much you get uh you've borrowed in the entire year that's this sum I equal 1 to 365 of f of well it's I over 365 time this delta T which I'll just leave as delta T here this is total amount borrowed now this is kind of a messy sum in fact your your bank probably will keep track of it and they know how to do that but when we're modeling things with strategies you know trading strategies of course you're really some kind of financial engineer and you want to cleverly optimize how much you borrow and how much you spend and how much you invest this is going to be very very similar to the integral from 0 to one of f of t DT at at the scale of uh 1 over 35 uh it's it's probably uh good to 365 it's probably enough for many purposes now however there's there's another thing that you would want to model which is equally important this is how much you borrowed but there's also how much you owe the bank at the end of the year and the amount that you owe the bank at the end of the year I'm going to do it in a fancy way it's you um the interest we'll say is compounded continuously so the interest rate if you start out with p as your principal then after time T you owe so borrow P After Time T you owe P time e to the RT R is your interest rate say 005 per year okay that would be an example of a of an interest rate and so if you want to understand how much money you actually owe at the end of the year at the end of the year what you owe is well you borrowed these amounts here but now you owe more at the end of the year you ow e to the power R times the amount of time left in the year so the amount of time left in the year is 1 minus I over 365 or 365 minus I days left so this is 1 minus I over 365 and this is what you have to add up to see how much you owe and that is essentially the integral from 0 to 1 the delta T comes out and you have here e to the r * 1 minus t so the t is replacing this I over 365 F of T DT and so when you when you start computing and thinking about what's the right strategy you you're faced with integrals of this type all right so that's just an example and see you next time remember to think about questions that you'll ask next time