Hi, everyone. We're going to start this lecture off with a question that at first may seem unrelated to anything we've done in the past, but you'll find very quickly that through the interconnections of math, it is actually quite related and fascinating why it is. Let's start off with the function. I'll fix something different. How about f of x equals x squared? But I only want to look at the small interval between zero and one just to keep things simple for now. Let's graph that. We have the right side of the parabola. The height is one. We'll draw it nice and big just to see where it's going. Here's the question for you. The question is, what is the area under this curve? That's the question. Find the area. What is the area under the curve? If you notice, the shape is not one that we know. It looks like a triangle, but it's not. It's got a parabolic top to it. It's not something we know. The question arises, if I want to find the areas of these irregular shapes, how do I do that? How do I do that? The person who answered that in the way that we're going to go forward with, his name is Raymond. We are going to do what he did, and that's approximate with rectangles. To keep things simple, we'll start with two rectangles to start. Just two simple rectangles. We will draw them with equal bases. We'll split the interval in half and we'll draw two rectangles. We'll draw them whose height lives on the curve. From the right end point of the interval, that'll be the height. You can tell what the base is. He said this: the area is going to be approximated by the sum of the areas of these two rectangles. Now, it's going to be an overestimate, but it's okay. At least I have some estimate. It'll be a little more. Area of a rectangle, this I know. It's base times the height plus base times the height. The base, just the way I drew these, the interval is of length one from zero to one and half of it is one half. The height of the rectangle comes from the function. The height of this rectangle, because I drew it in such a way where at least the height is right in the function, I can get the exact value. This is just one-half squared. So you plug in one-half into the function. The second base of the second rectangle is also one-half. Its height comes from the graph or from the function. If I plug in one, I get one squared. That's just one. I can find these two areas of simpler things and I get back something that I can calculate. One-half squared is a fourth, times another half is one-eighth. Then one-half times one squared of course is a half. This becomes 10 over 16 or five-eighths. If you want this as a decimal, if you're trying to find actual area, some people like to see the actual decimal, 0.65 would be our decimal expansion. It's an overestimate, but it's something. This is where there's no bad ideas and brainstorm. If you come back and say, ''I have no way to do this,'' and someone comes back and says, ''At least it's no more than 0.65.'' You're getting somewhere. You're getting somewhere. The beauty of this idea is that, well, what if we tried to do more rectangles? This is where it grows and expands. Let's try another picture over here with, let's just say n equals three. What happens if we tried three rectangles? Does it make our picture a little easier? I'll redraw the picture just so we can draw on it. Again, here's the graph f of x equals x squared. We'll just care about the interval between zero and one. I'm going to draw three rectangles equally spaced. Let's divide the interval into thirds. We have one-third and two-thirds. We'll draw little baby rectangles that the height lives on the graph. We get to here. I have three rectangles drawn. We're going to find the area underneath the rectangles. This will still be an overestimate. That's not bad, but idea is were getting better. Then hopefully you can start to see how this is going to generalize. The area is approximated by, the key is it's not equal to. I'm just approximating, which is not a bad thing to do if you're trying to figure it out, the area of the three rectangles; rectangle one, two and three. Area of a rectangle, I know. Its base times the height. Base times the height, base times the height. Each base, just the way I drew the picture, is equal. They all have one-third as a base. That's easy to figure out. The height comes from the function. The height of the rectangle comes from the function. You plug in the end point. This will be one-third squared, and then plus my base again which is a third, and then I have two-thirds squared. Then my final base is also a third, and then the right end point of the third rectangle is one, so its height is one or one squared. We can put down just to be consistent. Basically I go over and grab the calculator. I have one-third square, which is one over 27. These are long calculations, a little tedious, so we try not to do too many of these by hands. By hand this becomes four over 27. Then nice thing is they have the same denominators. That's not the end of the world, at least the first two. Then one-third over here has our third number. We can add these up and we can get a fraction. 127th plus 427th is obviously 527th. Then we can have fun adding fractions, take plus a third. If I'm doing this correctly, you get about, let's put a decimal down, 5185. You can check. To go four decimals. It's not surprising a thing to notice is that our number got a little better. I guess the takeaway here is where I originally had 0.6 as my overestimate. With the more rectangles, there was less error. It wasn't overestimating as much because the rectangles are now smaller. My area went from 0.65 to a better upper bound of 0.5185. Of course the idea is, well, what if I wanted to have an even more accurate or better way to do this? Well, the answer would be to add more rectangles, and you can almost imagine this with a picture. If I had, let's say four rectangles because I'm not going to work out the decimal expansion because it gets a little tedious. But if I take my function f of x equals x squared, and again, I just pick some finite area, so 0-1 just because the numbers are nice, and I'm trying to estimate this thing. If I had a lot of rectangles, let's say 10 or something like that, so they would have small little bases, and they would all add up to give me an estimate of the area. But the smaller the rectangles are, that means the smaller the error terms are, and so the more and more rectangles that I can use that I want to calculate will get me a better accurate, so whatever this is. How many rectangles does it draw? 1, 2, 3, 4, 5, 6, 7, 8, 9, so we would say this is our nine. We're approximating the area by finding nine rectangles. How you draw the picture, it will be an overestimate or underestimate, but either way, it's not going to be the exact area, this is the idea. The question is, can you generalize to find the actual area? Let's think about how we did this. The base of any particular rectangle is found, so we have n rectangles, in this case, we'd say n equals 9. N will be the number of rectangles, so let's introduce this variable, number of rectangles. Whatever my interval is, let's give it from 0-1. The base of any particular rectangle is going to be the length of the interval, which was 1 divided by n. We introduced this because it's a change on the x-axis, we call this delta x, and this will be in our case, how do we find it if we call the two end points a and b? The general formula is going to be the right end point minus the left-hand point, that's the length of the distance. That's the length of the interval divided by n. In our example here from 0-1, it's going to be 1 over n and you can check when I had two rectangles, it works, the base was a half. When I had three rectangles, it works, the base was the third. The base of the rectangle is 1 over n. For our particular example, in general, it's the right end point minus the left-hand point over n. There's my base. The area which is going to be approximated by these rectangles, however many I want. Let's try to abstract this a little bit from our n, is found by putting the base times the height. What do I need here? I have the base for each one is 1 over n, now I need the height of the rectangle. The height came from looking at the value, the x value that was there, so some x value and then the height came from plugging in to get f, the other function. Now because I know the function, I can do this. I really need an expression for that interval, that term, again because it's broken up and because I know the end points I can do this. We should put this over here somewhere, so the term, the first term, the second term, the third term, you can find a pattern for this. The terms are given by the left endpoint and then I'm just going to add the base, so i delta x. Take left-hand point and add head move over as many times as you want, so what does this say like? The first x value is going to be 0 plus 1 over n, in this case is 1 over n, and that was what we found. When we had two terms, the first value we plugged in with a half. Start where the interval starts, in our case, which is 0 plus 2 times 1 over n or 2 over n. When we had three intervals that made sense, remember was two-thirds, that was the second x value. Let me box it up for us for now, so we have two formulas going on, that were generalizing our specific case. These two formulas allow us to find the height. Because remember the height is just f of x_1 plus, and then we have the base again. Then we do f of x_2 plus dot, dot, dot, the base which we said was 1 over n, and then we take the last endpoint, so I want expressions for all these things. Then if I want to know what the area is for n rectangles, mine just clean, I just plug in n equals whatever number I want. If I want nine, I get this, if l want 10, I plug in n equals 10. For this particular function, remember we said the function was x squared, it's going to be 1 over n. Let's just work this out, so x_1, we said was 1 over n squared, and then 1 over n and then x_2 becomes 2 over n squared and you work your way up and you can imagine 1 over n times 3 over n squared. The last one becomes when it's finally x to the n, that's x to the n, the last nth term I want is 0 plus n over 1 over n, that's just one. That's what we got last time too, so it becomes one squared. I get this big expression, but you can tell I cleans up a little bit. Sometimes we write it using sigmas. There's a 1 over n in every single term, we can factor that out, and you get one squared over n squared, something like this. Four over n squared, one squared is the last term, and you can plug this in. It turns out there'll be formulas to even simplify what is left. Which is nice. All these terms. If you write the one as n squared over n squared, even this factor is even more. Imagine that last one squared is n squared over n squared. There's an n squared in every single denominator. Factor that out to get one over n cubed. You get one plus four, which I'm going to write it as two squared. The next term would have been three squared all the way up to n squared. It's fortunate that there's a formula for the pattern for this to plug in. You are not going to have to do all the arithmetic here, but you can tell like it cleans up, that's the big point, the big picture, that it would clean up. Where's this going? One over n cubed. This formula is in the book. I don't, unless you saw it in pre-calc sometimes to do it when uncovers induction, there's a formula for this and it is giving, we'll talk more about this when we do more examples, but it's n plus one, then 2n plus one all over six. Put it all together and this is your expression. The point of all this is you pick an n, the empire and the better and it will approximate the area. Now, that's a nice little way to find area under curve. This is mostly arithmetic. We have a cute little formula. So the formula here is, there's a formula for this to get a stat, that's all fine. What is the takeaway here though? If I wanted the actual area, which was the thing that I'm after, how would I do that? Here's the calculus jumped. I go from a finite to the infinite. If I want the actual area, I need infinitely many rectangles. Can't have any finite number whose any finite number is going to have an error smaller the rectangles get, think of like an infinitely thin, like a strip. That's how I get the limit. The limit of these rectangle, the area comes from the limit. The idea that Riemann had, and this is where the calculus comes in, is that the true area, so areas approximated by any number of rectangles, but the true area is going to be a limit as n goes to infinity of the number of rectangles to these finite sums are called Riemann sums. We say you named after him, and we say the area is the limit as n goes to infinity of these remote. Now, taking a limit is something I know how to do. This is really should call this like a huge idea because we're using calculus to find some finite number taking infinite limit of these rectangles, the more rectangles you can draw, the smaller they get, the basis get small, and we find a limit. In this example over here, it becomes a very simple rational function, a nice row one, or you can even do by hand without looking. If I want the area as a limit as n goes to infinity of this expression that I worked out. What does this become? So it's n plus one, 2n plus one over six n cubed. You say, wait a minute, it's just final limit, I can do that. That's a rational function. The degree of the top is degree three. If you put all the ns' together, you get n, n, and n. Three ns' and the bottom's degree three. I have a limit as n goes to infinity. Remember, this is going to be the ratio of the leading terms. If I were to multiply all this out, I don't have to, but you can get, you'll get 2n cubed plus a bunch of stuff over 6n cubed. The leading term determines the limit at infinity. When you do that, the ratio of leading chair and then just becomes 26 over one-third. One-third is a decimal course is 0.333. That's the true area under this parabola from zero to one. That's amazing, so 0.3 remember, what did we approximate it with before? We had 0.6 and we had 0.5. Those with really bad approximations is low number rectangles, two rectangles, three rectangles. If we were to work it out for 4, 5, 6, you would see these numbers getting closer and closer and closer to 0.3 repeating. Only when you added took a limit pass to the infinite, you would actually see this area. This is an example of where we're going and doing this with not just the interval from zero to one, which was nice and we'll do more of these, but this is the idea. We're going to find areas using limits. You say, how is this related to derivatives? The beauty of this all is that it actually is related to derivatives. That's mildly surprising, usually a first time you see that. Let's just take a summary here. We will do lots more of this. The big takeaway here is that the area of a region under a graph, f of x, continuous function, I'll say continuous. Just keep things nice, is on interval. Let's say a to b with delta x, or change our base, b minus a over n is the following. So it's going to be the limit as n goes to infinity of our Riemann sums, which is nothing more than lots of base times heights. They're adding up rectangles, so it's the sum from i equals one to n of f, x_i, being our sample point, x_i is our sample point. This is what we're going to use to pick the height from. For our cases here, you can use a plus i delta x. That'll get you the right endpoint. But it doesn't actually matter. So start with this though in understanding. If you think of this as a basis, this is a lot of heights and you're adding up areas of rectangles. Take the formula down, keep it handy. We will do lots more problems and videos to come. Keeping more sense of this as a way to find areas. See you next time.