I want to do an example. Once people see this crazy idea, sometimes there are some skeptics in the room. I want to do an example where this is the longest way ever to find an area that we know. Let's just take the line y equals x, just start with something we know. There's the line y equals x, and just to keep the numbers simple, let's do it from 0-1. Why not? There's the line. The area under the curve is a triangle. So if I asked you what the area of this is, we all, our eyes lit up we say, I know this. This is 1/2 base times height. So it's 1/2 the base is 1 and the height is 1 and so this is 1/2 like this. Correct. We know this. With a simple function, let's use Riemann's ideas of approximating with rectangles and see that this method actually works and the idea of like we can take lots and lots of rectangles to approximate the area. Here we go. We need a couple of things before we start. The first thing I always grab is what are the base of these rectangles? Remember the formula is b minus a over n. N is a variable, so n is the number of rectangles. We will let n go to infinity in a minute. B is your right endpoint and a is the left endpoint. In our case, it is 1 minus 0 over n, which is 1 over n, so grab that first. From that, find your sample point. Find the right endpoints. There's like x_1 and there's x_2. Find the formula for the generic value, the right endpoint for in our case, of what's going to give the height of the function, so x_1, x_2, x_3 and work it all over. The formula we're going to use as a plus I Delta x. A is the left endpoint, that's 0 for us, I is a variable, that's okay, and then Delta x we found in Step 1, that's 1 over n. Clean all that up and you get I over n. It is okay to have n as a variable. Remember, at the end of the day we're going to take a limit as n goes to infinity, so we want n as a variable: i is this other variable that counts up to n. If you've ever done any programming or have any experience, it's a double loop here, so you have two variables, I and n. Next is I need the height. What else do we need? We're going to need, before we go into our formula, the height of the rectangles. Now, the height changes. It's a function depending on where you are as you count up to n, so x_i. I take the function given. In this particular case, it's y equals x, fx equals x. So it's like f (i/n) but it's just the identity function. It gives back whatever you kick into it so you get back i over n. Depending on how complicated the function is, obviously this will change, but for our example here, we input I over n, then we output I over n as well. Now, we're getting there. Like everything else, let's put the formula down. The area will be the limit as n goes to infinity of Delta x factored out, and you can do a sum from I equals 1 to n of f(x_i). Let's put the formula down: base times height, base times height, base times height, add them all up. Where you put the Delta x if it's outside or inside, it doesn't matter because there is no index on the 1/n. So if you want to put it inside or outside, it does not matter. Now, it becomes a limit problem. We're going to write the limit every time. Let's replace what we know. Delta x is 1 over n, got that, times the sum from i equals 1 to n of f(x_i). That's Step 3. N is fixed. Think of n like it's 100 for a minute, and then you work this out, and then you make n 101, then you work it out, then you make n a million, it doesn't matter. I is counting up through n. So we have a nice double loop going on here. I is the index. What's happening with n doesn't matter inside the Sigma, if you want to think of the Sigma here, if you want to see it expanded. Sometimes sigma is great, but it hides what's actually going on. This is 1/n plus 2/n plus 3/n, et cetera, and it works this way up to n/n. If you notice, the n doesn't matter. The n you can factor out actually, and you get 1/n squared times the sum of i equals 1 to n over i. In general, when you have a Sigma, you try to simplify it as much as possible. Now, this is another formula that you may or may not have seen, but if you're adding up the numbers 1, 2, 3, 4 all the way up to some fixed number n, there is a shortcut to do that. If you haven't seen it before then take note of it now. This is famous because there's a story that Gauss as a child discovered it or something like that. Anyway, the formula is just n times n plus 1 over 2. This is just the formula. You can test it out if you want too. Add up the first n numbers and you'll see this actually works. The story, of course, is like Gauss as a child was given as a punishment to add up the numbers 1-100. His class was punished or something, and Gauss figured out the formula, so everyone else is away, 1 plus 2 plus 3. He just threw 100 into this formula and solved the answer and then left. Now, though, we're in familiar territory. This becomes n squared plus n over 2n squared. Now, we have a limit of a rational function as n is going to infinity. It is the ratio of the leading terms and you get a 1/2. I know it's the long way to get there, and we were expecting 1/2 the whole time, but sometimes it's nice to go through this and see that this idea actually gets us what we want. It doesn't contradict anything that we know prior. It's a nice little function. The more complicated the functions get, the steps get harder or the expressions get more involved. But for simpler formulas like lines and parabolas and cubics, we'll be able to write these things and solve for these actual areas. You can always use this in general, though, if you can't algebraically get up nice close thing, you can program this into a computer or a calculator and let it calculate as many areas under rectangles as you want, and especially when the shapes are crazy, this is what they do, and you can get as accurate as you need. Once you show this one, we will do more of these. Let's start with this one and go over this and make sure you can get 1/2. See you next time.