 Alright, we're going to continue our lecture 4443 for math 1210 at Southern Utah University. That's calculus one there. In the previous video, we finished up appendix e talking about geometric sums. And I want to start section 5.1 about areas and distances. This is like usual coming from James Stewart's calculus textbook. And so when we when we began our discussion about limits and derivatives, we used like the tangent line as a motivating example of why do we care about derivatives, the slope of a tangent line is exactly the derivative as well. And so when one tries to start thinking about integrals, we often use the notion of area as the motivating problem for why we care about integrals that so called area problem. So what do I mean by the area problem? Well, calculate an area of a geometric figure is actually a pretty important application of geometry, right? In your past geometry class, he's probably talked a lot about area problems. Let's you know, areas is a big deal, right areas of rectangles, areas of a rhombi area of a trapezoid area of a circle, we'll talk about that today. And this is not just like an elementary geometry type thing. Even in a course like modern geometries that I might teach to students, they deal with area sort of the big deal as well. So it's calculating area is a big important thing. And the easiest of all shapes to compute the area of is a square or maybe a rectangle, because the area of a rectangle is just length times width. That's a classic formula we know. The area of a parallelogram can be computed similarly by dissecting the polygon and rearranging it into a rectangle. Likewise, we could note that every triangle is half of a parallelogram. So we reconstruct the classic formula one half base times height. And so like if I were to actually draw out the parallelogram, what I meant would be like something like the following. You could always dissect your parallelogram so that you end up with a rectangle. This is a horrible drawing here. But you can basically cut off a triangle and move it to the other side and make a rectangle. And so the area of a parallelogram is itself one half the base times the height, like so. And then if you take a parallelogram, draw that one of those again, a parallelogram, half a parallelogram is just a triangle for which the the height of that would be right here, you get the usual one half base times height formula for a triangle. And we can do this for lots of different polygons, right? If we have, you know, some polygon that looks like the following, we could compute its area just by dissecting it into triangles, maybe something like that. So we could dissect this polygon into triangles, we could calculate the area of each of every one of these triangles. And then that gives us the area of the polygon. So dealing with polygons and areas, not such a big deal. This all comes from the area formula of a rectangle. But what happens when you start talking about things that aren't polygons? That is, what if the region is bounded by some curvy things, right? What if you want to talk about like the area of an ellipse, we have some type of oval or elliptical shape, how does one find the area of that, or the area of just a circle? Or if you want to find the area of a circle, how does one actually go about computing the area of a circle? Well, we're used to the classic formula that if you take the radius of the circle, r, then the area is equal to pi r squared. We get that. And so one thing I want to we're going to talk about in this chapter would be exactly why, amongst other things, is the area of the circle, pi r squared. Why not something else? Why not pi r cubed? Why not? Why pi? What has to do with this number of pi? Where is it coming from, right? And so what I want to talk about today is actually with regard to area, how one could approximate the number pi. And this is going to help motivate some principles we talk about later on in this chapter. So take the function f of x equals the square root of four minus x squared. And so to give you some idea where that's coming from, if we take the circle, which is centered at the origin and has a radius of two, that's the equation x squared plus y squared equals four. And if you solve for y, you see that's exactly where this formula comes from. You get y equals plus or minus the square root of four minus x squared. If you choose the plus, then you're going to end up with the upper semi circle. And if you take, if you go from on the boundary zero to two, that is you restrict your domain to zero to two, this will give you a quarter circle that you see illustrated here on the screen, a quarter circle. Well, why do I care about that? Well, if this area formula for the circle is to be to be believed, if we want to find the area of a quarter circle, we'll just take one fourth pi r squared. And if our radius here is two, we end up with one over four pi times two squared. This will just be four pi over four. And so the area of this quarter circle is the number pi bump bump bump. And so if we could calculate the area of this quarter circle, we would know what the number pi is. And so one could actually try to approximate the number pi by approximately the area under this quarter circle here. But how does one actually find the area bounded by this region? That is the region between the x axis, the y axis and this curve, y equals the square root of four minus one x squared. How could one do it? Well, like we were chatting about earlier, we can do areas of polygons. What's going on right here? This isn't sure I want. Where did you go? Where did you go? Sorry, I lost my picture. What am I going to do? Ah, here it is. Sorry about that, everyone. So one approach that we could try to take to calculate the area of this quarter circle, thus giving us the value of pi, is what if we try a rough approximation of the area using rectangles, because we can calculate area of rectangles. So what we're going to do is we're going to use two rectangles to try to approximate the area. So going from zero to two, I'm going to break it up into two regions. And so we're going to get these numbers zero, one and two, as these little markers along the x axis. And so this is going to represent the length of your circle, of your rectangle here. So notice that if we go from zero to one, that's a unit of one. If we go from one to two, that's a unit of one. So in this situation, we're going to take, let's call it the width. The width of each of these rectangles is equal to just the number one. Now we have to consider the height of these things. How tall are these rectangles? Well, to determine the height, I mean, if we want a good estimate, the height of the rectangle should somehow coincide with the height of the function. So what if we pick this point right here on the left? This is just f of zero, and we could set the height of this rectangle to be to be f of zero. And then for the second one, so this was our first rectangle. And this is our second rectangle. What if we set the height of the rectangle right here to be f of one, given this function. And so if we take rectangle one plus rectangle two, their areas should add up together should have length times width, because the so we're going to get length one width one plus length two width two. Well, to make life easier, I'm going to I chose these points zero one and one two to be equidistant. That is, they're evenly spaced. So that w one and w two are actually just the same value just w. And so I'm going to factor out this w value right here. And also by convenience, since w is just one, I'm just going to get the length of the first one times the length of the second one. And the length here is just f of zero plus f of one, like so. And when I say f here, I'm talking about the function that we had before, f of x equals the square root of four minus x squared. So if I evaluate that at zero, I'm going to end up with the square root of four. And if I evaluate at one, I'm going to end up with the square root of three. Well, the square root of four is easy enough, that's just a two. So we get two plus the square root of three, which if we were to use like a calculator or basically just Newton's method, which we learned in the previous chapter, we can compute approximate the square root of three to pretty good accuracy. And so two plus the square of three will be approximately 3.7321. And so this we claim is an estimate of pi. Well, is it a very good estimate of pi? That's not the best one that's ever existed, right? If we round it to the nearest whole number, that's four, pi is approximately 3.14159, right? So it's not the best estimate. But I mean, if you're like pi is 17, clearly that this is a better estimate than that. And when it comes to estimates, it's always about perspective, right? Relative this epsilon delta business, 3.7321 is good in a decent scale, right? But we could possibly do better. Now, you'll kind of notice that the issue before I leave this example here, the issue is that this is going to be an overestimate, right? Because you'll notice that our rectangles were sticking above the curve right here. So I get all this extra area that I don't want as part of pi. So I need to actually kind of compensate for that. So the reason we got this extra bit is because we chose points on the left side of each of these intervals to determine the height of the rectangle. Well, what if I try the other way around? What if I try the same same basic ideas before, but we're going to subdivide the x axis, zero, one and two again. But what if we select the height of the rectangle to be the point on the right? So this time, the height of the rectangle is f of one for the first rectangle. And for the second rectangle, you might not see it. But its height was the term to be f of two. And so pi here is going to be approximately just like before f of one plus f of two. Again, you're multiplying all of these by the width, which of course is just one. So you get f of one plus f of two. And so we did f of one just a moment ago f of one was two plus the square root of three. I'm sorry, it was just that was the sum of everything I'm my bad. If we just plug f of one here, get rid of that f of one was just the square root of three. The two was the square root of four. But then f of two here, we get the square root of four minus four. Oh, that's going to be the square root of three plus zero. So our estimate right here is the square root of square root of three, which again, using like Newton's method, we could approximate the square root of three, and we get 1.7321. This is just the answer we got a moment ago. But we had a plus two to it. And so then we get this next estimate that pi is approximately 1.7321. Is that a good estimate? It's not the best estimate that's ever existed in the world. But again, if you think pi is like 17 million, 1.7 is pretty good. It's pretty close. But we could probably improve upon this. And that's what I want to do. But you'll notice in this situation, our estimate is actually smaller than the true value of pi. And you'll notice there's a lot of gap that's going on here, this rectangle missed out on this area right here. And the second rectangle sent to a zero had no area missed out on a ton. So this isn't going to be a very good answer. But if you compare the two pictures, it's like this, this area right here is going to be underestimating the value of pi. It's under the true value. But if we go back to the picture we had before, this picture right here is going to overestimate the value of pi. So knowing one is an overestimate and one is an underestimate, you can actually put these things together. They go find the picture out in the before. Oh, where is it? Picture picture. There you are. Here's my cute little picture zoom in there. So what we're gonna do is we're gonna try to estimate the area we have before. So let's take the first one where the height of the rectangle was determined by the left endpoint strategy. Let's call that thing L two. So it was it was we use two rectangles with the left end points. This remember was an overestimate on the value of pi. And then if we take the second attempt we did, we'll call that the right endpoint method, we'll call it R two. We use two rectangles and we use the right end points to determine the height. That was an underestimate here. And since we know one overestimates and one underestimates, what if we add these together and we average them? So we take L two plus R two and divide that by two that gives us the average. Well, remember L two was two plus the square root of three. R two was the square root of three. And then if you add those together divided by two, those will give us two plus two root three over two, which gives one plus the square root of three, which as an estimate, that'll be approximately equal to 2.7321, which turns out is compared to the other two is a better estimate of pi again, is it perfect? No, but it's a lot closer to the 3.14159 we were looking for. And so this number right here, this L two plus R two over two, we are going to call this T two. And the idea is that we have this left endpoint and right endpoint approach. This worry here is what we're describing as what's commonly referred to as the trapezoid rule, where you average the left and right end points together. What does that have to do with trapezoids? Well, the idea is the following. If you take a rectangle, let's draw the picture right here, if you take a rectangle, where they have the same width, where one is one height, and another is a different height, maybe you have a shorter rectangle again, they have the same width right here. What you could do is if you want to average together the area, you could take the secant line that goes from one corner of the shorter one to the corner of the upper one. And this makes a trapezoid. And the area of this trapezoid will be the average of the area of those two rectangles. So what you can see here is that in the picture illustrated right here, you have what's called T two, the trapezoid or the trapezoid approximation using two trapezoids. The height is determined by the height of one court compared to the height of the other. That is, we take the end points at zero, at one, and at two, and we're going to connect them together and form trapezoids. Well, this trapezoid is going to approximate the rectangles we did before. Is it perfect? No, you'll notice there still is a little bit of a gap that's going on right here. And so we don't have a perfect estimate. The next thing so we can get a better estimate by this trapezoid rule, but it's still not perfect. One other strategy that we could do is returning to the idea of rectangles here, right? We have just two subdivisions, zero, one and two. Again, we want to estimate the height. We want to estimate pi using these rectangles. The width is still going to equal one, because that's how far apart these things are. The distance between these things is just still one. But why do we have to use the left or right end points to determine the height of the rectangle? Because again, the rectangles height needs to kind of mimic the height of the function. What if we look for a point that is halfway in between the points right here? So for example, what if we use the so-called midpoint between these numbers? So let's put these numbers back on the screen, zero, one and two. What if we take the point, point five, which is halfway between zero and one, and then we determine the height of the rectangle to be f of one half. And we'll do the same thing over here. We're going to take 1.5 as this midpoint. 1.5 of course is just three halves. And what if we determine the height of the rectangle to be f of three halves? Like so. So you'll notice one advantage of using this midpoint is that although there's some gap that's below the curve, there's also some gap that's above the curves that kind of cancel each other out. You have a gap that's under here, but you also have this gap that's over here. And so this midpoint kind of balances things out. So we would see that pi is going to be approximately f of one half plus f of three halves. Of course times it by the width, but the width is one here. So we're looking at f of point five plus f of one point five. Now using the function of square root of four minus x squared, we end up with the square root of four minus a fourth one half squared plus the square root of four minus nine halves like so. We can add those together. We're going to get the square root of 15 force plus here, you're going to get the square root of 16 minus nine. That should be seven halves, seven fourths, excuse me. And so then our estimate turns out to be the square root of 15 plus the square root of seven all over two, the square root of four is two, of course. And so in this situation, we could try to estimate these things to square root of 15, square root of seven. And we put this all together, our estimate this time looks like 3.2594. And so you can start to see that our estimate for pi is getting a little bit better 3.2. That's better than like the 2.7s we had before, at least the first digit in front of the decimals right now. And so we can determine, we can sort of estimate the area under a curve using these rectangles. And how we decide on the height of the rectangle determines how good of an estimate we have this midpoint rule right here where we pick the midpoint of the segment to be the height determine the height is actually a pretty good estimate. But you know that this is what we get with only two rectangles. So this is what we call M two right here. This is how good we can get with only two two rectangles. The issue is that we're trying to fit. I mean, we're literally trying to fit a square peg inside of a round hole, right? So we there's going to be problems like we see here with this this under estimate over estimate right here, how can we improve upon the error? Well, one idea is to use more rectangles. What if we have more rectangles in this picture? Let's see, I think I had a picture where we have four. Let me see if I can find it. It is hidden right here. What if we just use four rectangles to try to estimate the area under the curve? This is this right here would be what we call left four. We use the left end points to determine the height of the rectangle right here. So let's subdivide we start from zero going up to two, we're going to cut it in half and we cut in half again. So we get point five and point one point five. Right. And so if we want to estimate the area under this curve, this is going to look like f of zero plus f of point five plus f of one plus f of one point five, those are the heights of each of the rectangles. But now what's the width this time? The widths no longer a one. If we look at the distance, the distance between any of these two markers, that's always a distance of one half now. So we're going to end up with f of zero. Remember, that was a two. We're going to get f of point five. That was the square root of 3.75. We get f of one, which was the square root of three. And then we get f of 1.5, which is the square root of 1.75. We did those earlier. And we're going to times each of these by point five. Right. It's kind of a tedious arithmetic, especially since the square roots are there. But we could approximate the square roots using Newton's method. And the rest of it's just straightforward arithmetic, tedious as it might be. It's still as possible. And so we end up with, if you distribute the one half through, we end up with one plus the square root of 15 over four, plus the square root of three over two, plus the square root of seven over four. And so if we approximate this quantity right here, we'll get approximately 3.4957. And so I want to compare this to the 3.7 321 we did when we did L2. So this right here is L4 using four rectangles improves the estimate we got closer to the 3.14159 figure. And that's what happens in generals, the more and more rectangles you use, the better and better the estimate is. So you see the following picture in front of you, there are, let's see, one, one, two, three, four, five, six, seven, eight, nine, 10, we could estimate pi using L10. What if we use 10 subdivisions, 10 rectangles to calculate the area of these things? Well, if we do that, we're going to have to take the width, which will come to that in just a second. And then we get this f of zero plus f of Oh, what's the next one point two plus f of point four would be the next one. And then there's a bunch of things until eventually we terminate with f of 1.8. If we keep track of all these things are now this w is the thickness of one of these things right here. And so if we start off at zero, and the next one was point two, that's actually the distance all of these W's are point two. And notation we're going to start using later on instead of w, we're going to call this delta x. We'll talk about more this in the next video. And so we end up with L10 is this point two times a sum of a bunch of things. And when you have a sum, we can use the sigma notation we saw in appendix e, where we can take the sum where i equals one up to how many rectangles we had was 10. And we're going to take f of some number that number is going to look like just i times point two. We'll talk some more about this in the future here, but you're going to take a sum of different things. And we can estimate this sum if we take 10 subdivisions, this thing would turn out to be 3.3045. See right here. And so that gives us an estimate of what pi is. And again, the more and more rectangles we use, the better, better these methods become. So I want to kind of show you just some data that you would get here. So if we first look at the left sum ln, what what, excuse me, what do those look like? If you use two, two rectangles, you get 3.732 when we did that one, we did four rectangles, which is 3.4957. And we just talked about 10 rectangles 3.3045. If you keep on increasing 20 rectangles, you get 3.2250 rectangles, you get 3.17 100 rectangles, you get with 3.16. And if you do 500 rectangles, you're going to get 3.1455. And that's starting to look a lot like the number pi we're used to, right? Pi is approximately 3.14159. So it takes, it takes about five rectangles before this left rule starts to look like pi up to two decimal places. But nonetheless, we can make this estimate. If we try the right rule, Rn, we can we did two rectangles, we talked that we could do four rectangles or 10 rectangles. If you jump up to 500 rectangles, you get 3.1375. So again, rounding that that's almost accurate to two decimal places. Now, if you average these things together, because again, the left rule here is going to be over estimating the value of pi and the right rule is going to be underestimating the value of pi here. If you average those together with this trapezoid rule, you get a lot better, right? If you look at 10 rectangles, you get 3.1045. That's accurate to one decimal place. If you jump up to 500, it's like, wow, that looks spot on 3.1415. Wow, that looks great, right? The midpoint rule, remember, is the one where you take the middle of the segment. And with two, it did pretty good 3.2. With 10, you get 3.15. That's really good. And if you come up to 500 rectangles, you get 3.1415, sorry, 3.1416. Now, you might be tempted to think the trapezoid rule did better here because it's 3.1415. But if you take the expansion of pi and you round it to three decimal places, don't you get 3.1416? So actually, the midpoint rule in this contest is the winner, winner, winner. It actually has the best estimate for pi. And it's accurate to two to four decimal places right here. Now, that takes a lot of rectangles in order to get that level of accuracy, like we kind of saw in the previous slide, in order to deal with these rectangles. You're dealing with some sigmas, but we're talking about a big, big sigmas, right? You cannot do those one by one by one by one. If you want to compute these sigma operations, you're going to need formulas to help you. Because again, 500 sums is just 500 terms is just too too too much. And also where our goal is is the following. We aren't necessarily interested with 500 because I mean, because we could do better, why not 1000? Why not a trillion, right? The more and more rectangles we get, the better, better, better the thing gets. And so what if we take the limit as the number of rectangles goes towards infinity? So we get more and more and more and more. If we allow the number of rectangles to go towards infinity, then our error gets smaller and smaller and smaller until eventually when we take the limit, we get perfection, we no longer have any error, we're not overestimating or underestimating, we can get equal to pi by taking more and more and more things. And so if we take the limit as n goes to infinity, well, we're taking the limit of a sigma of stuff, right? Sigma of f of something times this delta x thing right here. And so these things right here limits of the sigmas are how we can calculate the area under a curve by proximity with rectangles. And in the next section, we'll talk some more about this in the next video, I should say. So stay tuned for lecture 44. And as always, if you liked this video, feel free to subscribe so you can get announcements and new videos as they get produced. Like this video, comment if you if you like it, right? And if you have any questions, please, please, please push your comments below and I'll be happy to answer them. I'll see you next time. Have some fun calculating. Bye.