 So, last time we were able to find a Riemann sum, oh wait, no, it's not pronounced Riemann, it's pronounced Riemann sum, and we were able to find a Riemann sum that approximated the area of a region, but it did so pretty loosely in that we got a very large difference between the lowest possible area and the highest possible area. It's sort of like saying the population of the United States is somewhere between 7 and 5 billion, and we'd like to get a somewhat more accurate value for the actual number. So, to do that we can use something that sometimes is called Newton's theorem. Just a little bit of historical background, Newton was one of the 17th century mathematicians who began looking at the problems that would form calculus, and Newton, along with Leibniz, is usually given credit for having invented calculus. This is somewhat akin to giving Bill Gates credit for having invented the computer. It's vaguely true, but that's a different story. So, suppose I want to use the lower sum to approximate the area of some region. So, again, I'm going to take some region, I'll partition it, I'll draw the largest rectangles that will fit into those regions, and then what I have is this error that is between the area of the rectangles and the actual area of the region, and in this picture it's white, but let's go ahead and fill that in, let's shade that in, and the shaded region corresponds to the error in using the lower sum as an approximation to the area of the entire region. Now, through the magic of advanced CGI animation, I'm going to slide all of those pieces over, so here goes. So, I'm going to take those shaded regions that represents the area, and slide them over, and I'll slide those over as well. Why did I do that? Well, partly because I wanted to make things a little bit easier. This shaded region corresponds to the area, so if I have some idea of how big that is, then I have some idea of how accurate my lower sum is going to be. So, what can I do to find the area? Well, let's put it into a box, and in this case, if I just slide the pieces over, the stack of error pieces reaches to a high point that's the same as the highest function value over the region, and the low point is the same as the lowest function value over the region, and the width is the maximum width of the subintervals. So, here notice that the three intervals don't have the same width. This error piece comes from my first interval, this error piece from the last interval is a little bit narrower, and this piece here from my middle interval is a little bit wider, and so those three pieces don't have the same width, but that doesn't matter. I could throw them into a large box that fits all those pieces, and there's a little bit more space in that box, but I'm not going to worry about that. I'll fill that with packing foam or something like that. And so the question is, how big of an error do I have? Well, I don't know exactly, but I can tell you that the error is less than the area of the rectangle, and that's good because I know how to find the area of a rectangle, and this is the basis for Newton's theorem, and there are some qualifiers. I have to have an increasing function or equivalently a decreasing function, and if I have one or the other, then the error in using either the upper or the lower sum as an approximation for the area is less than or equal to the maximum width of the interval times the difference in height between the lowest and the highest points, and the reason that that happens is that the width of the largest, of the widest interval times the difference in height gives me the area of this rectangle, and I know all of those error pieces fit into that rectangle. And that's a wonderful piece of news because it means that for any partition of the interval, I can tell you what the maximum error is, and with any luck, the actual error will be less, hopefully significantly less than the maximum. So for example, let's take a look at our graph y equals x squared. So again, it's got to be a region, so I'm going to be under a graph above the axis over the interval from zero to four. I'm going to use the lower sum with n equals four rectangles, and then I want to find the maximum error of the estimate. So I need four rectangles, so I need three partition points. So I'm going to partition at x equals one, two, and three. That gives me one, two, three, four regions. I can find the lower rectangles. They look something like that. I can find the areas of all those lower rectangles, and then my lower sum is just going to be the sum of all those areas, going to be 18. So how about those errors? Well, it's going to be the shaded region, and you don't need to do this, but again, through the magic of CGI, I'm going to slide all those regions to the left and then I can stack them, and here's the thing to notice here. Because of the way that I've chosen my subintervals, all of those intervals are exactly the same width. Those are all width one intervals, which means that when I stack them, they all fit in this first space here. So they also all fit into that rectangle, and the top of the rectangle up here is going to be at y equals 26, corresponding to this point over here on the graph. The bottom of the rectangle is going to be at y equals 1, corresponding to the low point of the graph. So I know the height of the stack, 26 minus 1, 25, the width of the stack, 1, and so the area is going to be 25. And so what that means is that the error in using my lower sum, 18, as my approximation, well the error, these little triangular-ish shaped pieces in there, they're not triangles, but these pieces in here that are sort of triangular shaped, those areas all together are going to be less than the area of this rectangle, 25. So that tells me if I want to give an even better range here, I know that the actual area is going to be some place between 18, which I know is less, and 18 plus 25 equals 43, which I know is more. Well, you might say that's still not very good. That gives us an area somewhere between 18 and 43, and that's quite a bit of space. So why did we go through all of them? And the answer to that question is, say I want the error, say I want the error to be small. Well, I can make the error small by making this rectangle very small. Now that rectangle is going to be constrained by two factors. First off, the height. I can't do anything about the height because the height is just going to be the difference between the lowest and highest Y values of the function in the region of interest. So the height I'm kind of stuck with. So how do I make the area of a rectangle small? Well, if I can't change the height, then I have to change the width. And remember the width of this rectangle is the width of the maximum of the subintervals. It's the maximum width of all the subintervals. So if I want to get a small area, I'm stuck with the height, so I take a very small width. Now we can actually compute how wide that has to be. So let's take a look at a problem here. So I have the graph Y equals X squared. I'm looking at the region between Y equals X squared and the X axis over some interval. And now I want to find that area to within, say, 0.1 square units. And so the question is, well, where should I partition the interval and how many intervals are there going to be? Since the only tool we have at our disposal is Newton's theorem, let's see if we can apply Newton's theorem. So I have to have a function that is increasing, a graph that is rising, and Y equals X squared is rising over the interval in question. And so that tells me I can apply Newton's theorem, and the error is going to be no more than the width of the widest subinterval, multiplied by the difference between the maximum and minimum Y values over the interval in question. So since my function is increasing, my graph is rising, the maximum Y value occurs here at X equals 4. That's going to be at Y equals 16. The minimum Y value is going to occur here at X equals 1. And so that's going to give me Y value 1. And so the difference between the maximum and minimum is going to be 15. So remember, the error in using either the upper or lower sum in approximating the area is going to be the difference in those Y values times the width of the maximum width of any of those intervals. So that gives me an equation. I want the maximum width times 15 to be less than the error, because this, remember, is bigger than the actual error. So the actual error is less than this. So the error is going to be less than 0.1, which is what we want. And that's one of those really, really hard challenging algebraic equations. Well, actually, it's pretty easy to solve. That's 0.1 over 15. The arithmetic is more challenging. If I simplify that, our maximum width should be less than or equal to 1 over 150. Now, what that means is I want the width of any of those subintervals to be no more than 1 over 150. So what's my interval? Where am I going to partition the intervals? Well, I want the first interval to go from 1 to some place where the width is no more than 1 over 150. So maybe I'll run it to 1 plus 150. So then my first interval runs from x equals 1 to x equals 1 plus 150. The width is just 150, which is what I want. How about my next interval? Well, that's going to run from 1 plus 150 to, well, how about 1 plus 2 times 150? So again, this interval from here to here has width equal to 1 over 150. And again, I want the maximum width of any of these intervals to be less than or equal to 1 over 150. And if I keep doing that, if I make all of those intervals have that width 1 over 150, then I've ensured that my maximum width is less than what it needs to be. Now, we do want to eventually get to x equals 4. So for that, it's worth noting that 4 is 1 plus 450 times 1 over 150. And what that says is that I need 450 intervals, each of which has width 1 over 150, to get my area accurate within .1 units. So if we're going to do that, we'd better start calculating. Well, let's see if we can find an easier way of doing this, and that'll require a little bit of analysis.