 Let's look at one last example of Simpson's rule before we move on to a new topic. Let's use Simpson's rule with 10 subdivisions to compute the integral zero to one e to the x squared dx. And let's see how good of an estimate it is. So notice here that e to the x squared is like before. It doesn't have an, it has a no elementary antiderivative. The fundamental theorem of calculus cannot help us compute this thing. We wanna do a numerical calculation. So the integral from zero to one of e to the x squared dx, we're gonna compute this using Simpson's rule with 10 subdivisions. We can go through the details of this, but I also just recommend to use the calculator that's online. If you use a calculator, you'll spit out the number 1.462681. So this is an estimate. We can get this very quickly with the calculator if we just plug in the appropriate things. That's wonderful. But it's not just good enough to have the s, and we have to know how good of an estimate it is. And so how bad is the error in the situation? Well, like we saw before, the error associated to Simpson's rule is bounded above by k times b minus a to the fifth over 180 into the fourth. Now some of these things we know off the bat, b minus a is the length of the interval. So we get this portion right here, one minus zero. To the fifth, one minus zero of course is one, so that's just gonna disappear. Then we get 180 over, we're taking 10 subdivisions, so 10 to the fourth. And so working with this, we're gonna get k on top. We're gonna get 180, and then 10 to the fourth, that's just gonna give you 10 more zeros to connect, catnate on the bottom there. So you get 1.8 million on the bottom, all right? So how do we determine this k value? Remember, k is supposed to be a bound on the fourth derivative of this function on the interval zero to one, all right? Now if we take f, f is our function e to the x squared, we've done some of these calculations in a previous video, the first derivative, remember was two x e to the x squared, the second derivative was e to the x squared times two plus four x squared, if I remember that correctly. If we continue on with that, I'm not gonna go through necessarily all the details, well, okay, we can do some details, you twisted my arm there. Taking the derivative of this using the power of the product rule, right? If you take the derivative of two plus four x squared, that's an eight x times that by e to the x squared, add that to the derivative of e to the x squared, which it is two x e to the x squared, and then you have this two plus four x squared right there. We can combine some like terms because everything's still divisible by e to the x squared. Factor that thing out, you're gonna have an eight x, you have a two x, which distributes onto the two, so that's a four x, you should have a 12 x right there, and then there is an eight x cubed as our third derivative, and then for the fourth derivative, we gotta do this one more time. Again, by the product rule, the derivative of e to the x squared is two x e to the x squared times by the polynomial 12 x plus eight x cubed. For the second one, we'll get an e to the x squared, and then the derivative is a 12 plus 24 x squared, we could factor out the e to the x squared, I guess we'll just do that, just make it a little bit cleaner, e to the x squared, that leaves behind a two x times a 12 x, that's gonna be 24 x squared, that combines with that one, that gives me a 48 x squared, two x times that by eight x cubed, that gives me a 16 x to the fourth, and then finally there should be a 12 right there, 12 plus 48 x squared plus 16 x to the fourth, that's great. What can we say about this function? This function, we could ascertain that, kind of like we did before, this guy right here, e to the x squared, this is always positive and increasing, this polynomial right here is also always positive and increasing, so our function right here will always be positive, and it'll be increasing, and when I say increasing of course, I mean on the interval zero to one, it's not increasing everywhere, and so in particular, our k value will be at the maximum, that's what it's supposed to be, but the maximum will be at the right endpoint, so this is gonna be the fourth derivative evaluated at one, so we get an e, we're gonna get 48 plus 16 plus 12, which adds up to be 76e, that is our k value, bring it back and plug it in right here, we're gonna get 76e over 1.8 million, and so you could simplify that thing, that's not necessary because we want a decimal approximation, so we need to approximate this, we're gonna get 0.000115, so this is the worst case scenario, our error cannot be worse than this, and as such, we're accurate to approximately four decimal places, accurate to at least three, but we're almost at fourth decimal place right there, this is what we got for the Simpson's rule using 10 subdivisions, just as a comparison right, we did the same calculation with the midpoint rule, with 10 subdivisions, and its error would be approximately, well it would be, I should say the error would be no worse than 0.007, so you can see that the Simpson's rule with the same number of calculations is by orders of magnitude more accurate on average, again, these are just error bounds, the error could be much, much, much smaller, but if you have the two options, like I know that Simpson's rule will, worst case scenario is much better than the worst case scenario of the midpoint, so in practice, Simpson's rule is gonna be the best method you're gonna wanna use in these calculations, so that brings us to the end of lecture 18, which also will close the book proverbially on section 7.7 about approximate integration, we are gonna have to do approximate integrals every once in a while, so those calculators that I mentioned keep those links readily available, because once in a while there will be integrals that we can't necessarily calculate by hands using the fundamental theorem calculus we wanna approximate those. Those will be very useful for us in chapter eight. In fact, chapter eight is gonna be about applications of integration, which we already did in chapter six of Stuart's textbook, but some things we postponed until chapter eight because the integrals are kinda just, they're too difficult to calculate, we need numerical approximations to determine what these values are gonna be, so stay tuned for that, and I'll see you next time, everyone.