I want to do an example. Once people see this crazy idea, sometimes there are some skeptics in the room. I wanted 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 and the area under the curve is a triangle. If I asked you what the area of this is, we all with our eyes light up. We say, I know this, this is one-half base times height. It's one-half, the base is one and the height is one and so this is one-half like this, correct. We know this, but let's, with this 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 this, what are the base of the rectangles? Remember the formula is b minus a over n, n is variable, so n is the number of rectangles. We will let n go to infinity in a minute. b is your right endpoint in a is the left endpoint. In our case, it is 1 minus 0 over n, which is 1 over n. Grab that first, from that, find your sample point, find the right endpoints, so there's like X_i and X_ii. 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_i, X_i, X_iii, and work it all over. The formula we're going to use as a plus i Delta X. a is the left endpoint that 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 is a variable. Remember at the end of the day we're going to take a limit as n goes to infinity, so you want, and as a variable, and 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, add 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 on as you count up to n, so X_i. I take the function given, in this particular case, it's y equals x, f(x) equals x. It's like f of i over n. But it's just the identity function gives back whatever you kick into it, so you get back i ever 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 of 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 i, there is no index, on the 1 over n. If you want to put it inside or outside, it does not matter. Now becomes a limit problem. We're going to write the limit every time. Let's replace what we know. Delta is 1 over n. Got that. At times the sum from i equals 1 to n of f of X_i. Then step 3, that becomes i over. n is fixed, think of them like it's 100 for a minute. Then you work this out, and then you make n 101, and you work it out, or you may get a million it doesn't matter. i as counting up through n. We have a nice double loop going on here. i is the index, so what's happening with n doesn't matter inside the Sigma. If you want to think of this Sigma here, if you want to see an expanded, sometimes Sigma is great, but it hides what's actually going on. This is 1 over n plus 2 over n plus 3 over n, et cetera. It works its way up to n over n. If you notice isn't, like the n doesn't matter. The n you can factor out actually, and you get 1 over n squared times the sum of i equals 1 to n of 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 and take note of it now. This is famous because like Gauss, there's a story that Gauss as child discovered it or something like that. Anyway, the formula is just n, n times n plus 1 over 2. This is just a formula. You can test it out if you want to add up the first n numbers and you'll see this actually works. The story of course, is like Gauss as child was given as a punishment to add up the numbers 1-100 is class was punished or something and Gauss figured out the formula, so everyone else's away, 1 plus 2 plus 3. He just throw a 100 into this formula and solved the answer and left. Anyway, so 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's go into infinity. It is the ratio of the leading terms and you get a half. I know it's a long way to get there and we were expecting a half the whole time. But sometimes it's nice to go through this and see that this idea actually gets us what we want and it doesn't contradict anything that we know prior. It's a nice little function. The more complicated the functions get, these steps get harder or the expressions get more involved. But for simpler formulas like lines and parabolas and cubics will 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 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 choose this one. We will do more of these, but start with this one and go over this and make sure you can get one-half. Okay. See you next time.