 We've seen in the previous video how we can use Simpson's rule to approximate the area under a curve. That is, we can use it to calculate an integral. And we calculate the error of our calculation compared to errors we did previously with the trapezoid and midpoint rule. And if I dare can say, Simpson's rule totally kicked the butt of both the midpoint rule and the Simpson's rule. It was vastly superior in its ability to approximate. Let's kind of see why. Much like the midpoint rule and trapezoidal rule, the Simpson's rule has an error bound we can compute. And it's gonna be similar in nature to the midpoint rule and the trapezoid rule, but there are some subtle differences as well. So, speaking of those, the error of the midpoint of Simpson's rule, excuse me, will be bounded above by the value, well, this thing right here, K times B minus A to the fifth divided by 180 into the fourth, right? So some things that are similar, you're gonna have a B minus A to some exponent, right? B minus A is the length of the interval. The longer the interval gets, the harder it is to accurately compute it, right? Because there's more stuff to take care of. But notice that the length of the interval is gonna grow by the fifth power instead of the third power. But to balance it out, there's an N to the fourth on the bottom. N to the fourth, N is the number of subdivisions you're gonna use. How many marks do you use along the line? And this is raised to the fourth power. And so the more, quote, unquote, rectangles are used, I mean, they're really like parabolic things, but the more rectangles you use, the greater the accuracy. Now, with the trapezoid rule, we had a 12 on the bottom. With the midpoint rule, we had a 24 on the bottom. With Simpson's rule, we have a 180. Don't worry too much where these numbers come from. It does come from a mathematical proof that we're not gonna go into right now. But you're gonna have a 180 in the bottom, which is really, really good. The other thing that's important to pay attention to a Simpson's rule is the K value is slightly different. K here is gonna be a bound on the fourth derivative. That's the fourth derivative, not the second derivative. So we're looking at the concavity of the concavity. Again, why does that one show up here? We're not gonna really go into the details of that. We're gonna sort of accept this error bound for Simpson's rule as gospel and kind of go from there. So this error bound is actually gonna predict that the Simpson's rule is gonna be much more accurate in general than the trapezoidal rule and the midpoint rule. And so if we compare this to what we've seen before, in a previous slide, we were looking at the integral one to two, one over x squared, one over x dx. And we know this is equal to the natural log of two. So we're trying to approximate the natural log of two right now. Now, if we were to apply this error bound to this setting, right, notice that our function f of x, it's one over x and we've done these derivatives already. So the first derivative is gonna be negative one over x squared. The second derivative, we already know is gonna be two over x cubed. We've done that one. If we continue on the third derivative, you're gonna get negative six over x to the fourth. And then finally, the fourth derivative, which is the one we need to be, the one we're worried about right now, this is gonna be 24 over x to the fifth. Much like the second derivative here, this function is always decreasing on its interval. The graph of this thing is gonna look something like the following. This is not perfectly drawn to scale by any means, but this thing will be decreasing. And so this k value is gonna show up right here at this maximum value at the left endpoint. And so this is simply just the fourth derivative evaluated at one, which we end up with 24. So that's what we can use for our k value. Therefore, the error of Simpson's rule is gonna be bounded above by 24 times two minus one to the fifth over 180 times, we had 10 subdivisions earlier, 10 to the fourth. So we get 24 on top, 180 times, well, when you take powers of 10, you're just gonna get four zeros and so we're just gonna concatenate four zeros on the end there. So we have 24 over 1.8 million, if I got the number of zeros there correctly. And so that is gonna shrink down. I mean, as a fraction, you can write this as one over 75,000. But really just through this in a calculator, we don't need a simplified fraction, we want a decimal, we're gonna get 0.0013. That's what we get right there. That's pretty small, right? That's accurate to four decimal places, almost a fifth decimal place there. Now we actually can compute the natural log of two, right? And if we subtract that from the estimate we had before, remember our estimate, our actual estimate, I'll put it right here, turned out to be 0.000003, right? So it turns out that our estimate was about, the actual error was about a third of what the predicted error could be, but that's the thing is this is just an error bound. This tells us the worst case scenario, it could be actually a lot better. And so this illustrates that just how effectively we can calculate the area, not the area, well, yeah, how accurately we can calculate the area under the curve using this technique of Simpson's rule. It works out really nicely here. Now what I wanna do is kind of erase the screen a little bit. Remember our K value is still gonna be 24, right? That's not gonna change right here. The K value only changes if we change the function or if we change the interval for which we're not gonna do that. What I wanna do here is ask how, well, I guess this is actually on the next slide, I'm sorry here, we already know the K value is going to be 24. So what we wanna ask is how large should we take in to be to guarantee that SN will be accurate to 0.0001, degrees of accuracy, right? And so working with that, let's play around with that error bound. So the error bound ES, it's bounded above by 24 is our K value. We're gonna get two minus one to the fifth, that's again one, we went 180 over into the fourth. So it's that in value that we need to know, 24 over 180 into the fourth. And so we want our error to be, we want our error to be 0.0001. So times both sides by 180. So we're gonna get 0.0001 times 180 into the fourth, that should be less than 24. Let's see, then we wanna solve for N, so divide both sides by 180, I guess I wanna move it back into the fourth, we're going to get 24 over 180. Oh, that doesn't look like an eight at all. 180 times 0.0001, if you don't want decimals, you can write this as a fraction. I'm not really too concerned about that at the current moment. And which case, then you take the fourth root of that and should be less than or equal to, I think I have my inequality backwards, don't I? Oh, I do, let me fix that real quick. My inequality should be facing the other way around. Honestly, a lot of students do this with an equal sign and so that's okay. It really is, we just mostly wanna get this number. We're gonna get the fourth root of this number right here, 24 over 180.001. And again, we could try to simplify this fraction, and this would be something like the fourth root of 4,000 over three. But really, this isn't even necessary here whatsoever because we're just gonna throw this in a calculator for an estimate. And so this will give us approximately 6.04. All right, that's the estimate we get right here. In order to be accurate to four decimal places, you need that N is greater than or equal to 6.04. So we have to round this up, but we don't round this up to the nearest integer. We have to round this up to the nearest even integer, right? So our answer is that we need to choose N to be greater than or equal to eight because we can't have 0.04 of a subdivision. It has to be a whole number. So we have to take the next number, but seven is incompatible for Simpson's rule. We can't do that with seven, so we have to go up to eight. So eight is the number we're looking for here. Now, the reason I mentioned this is that Simpson's rule can get four places of accuracy with eight subdivisions, eight calculations. The trapezoid rule, it needed, I should say the trapezoidal rule, ET, it needed an equal 41 to get this same level of accuracy. And the midpoint rule, its error to be less than four places of accuracy here, it needed to be 29 and equals 29 as we did before. And so you can see that the midpoint rule did a lot better than trapezoid rule, but again, Simpson's rule just kicks it in the bum. These other ones don't even stand a chance in comparison to it. So if one is sort of in practice trying to approximate an integral, Simpson's rule is a highly preferable method because it's simple, it really is simple. You just have that sequence of 1, 4, 2, 4, 2, 4, et cetera, right? You don't have to do any derivatives or any calculations like that. You just have to be able to calculate the function itself and have some linear combination of those things. It's very, very simple, easy to implement on a calculator like the one we saw on emathhelp.net and feel free to use those to help us, but we can get a highly accurate calculation with only eight subdivisions compared to 40 and 29. It's just really amazing. Simpson's rule is just that cool.