 Welcome back to our lecture series, Math 1220 Calculus II for students at Southern Utah University. As usual today, I am your professor, Dr. Andrew Misseldine. We are going to continue in lecture 18, our discussion of numerical approximation of integrals, and although the title of this lecture is called Simpsons Rule, we're going to start talking about that in the next video. In this video, I want to do one more example of using the techniques we've already learned about, particularly midpoint rule and trapezoidal rule, to determine the approximation of an integral and then to compute the error of that approximation. Consider the integral here. We have the integral 0 to 1 e to the x squared dx. Now, as hard as one tries, you're not going to find an elementary anti-derivative of e to the x squared. We basically need integration to describe this anti-derivative. We're going to have to compute this using some numerical techniques. As the instructions give us, we're going to look at the midpoint rule with 10 subdivisions. What would that look like? If we want to compute the integral from 0 to 1 of e to the x squared dx, that will be approximately equal to m sub 10. We're not saying this is exact, but this is an approximation. Now, this is going to be a tedious calculation. It's certainly doable, but be aware that to do this calculation, you're going to be better off using some type of calculator. Most graphing calculators come with some type of numerical calculation, approximation of some kind. Now, be aware that we want to do m sub 10, so to make sure we have the right approximation for this rule, I do recommend those online calculators I had presented in a previous video. You can find a link to those websites in the description below. If you use one of those, you're going to end up with an approximation of 1.460393, like so. We get this approximation. Again, this is just using the calculator that we saw before. Now, the issue that we really want to be concerned with is how good of an approximation is this? What is a bound on the error? What's the worst case scenario that our error could be? Now, we talked about this again in a previous video here, and that the error associated to the midpoint rule, this is going to be bounded above by k times b minus a cubed all over 24 n squared. So this is what general formula we learned about for the error associated to the midpoint rule. Now, plugging in specifics here, we know the bounds of our integral are going to be from 0 to 1. The b minus a, that's just the length of the interval that we're integrating. And so that's going to give us a 1 minus 0 cubed. That's nice, because 1 minus 0 is 1, and 1 cubed is 1. This will sit above 24. That's just the coefficient that shows up for the midpoint rule. We have a 12 there for the trapezoidal rule. And the number of subdivisions that we're using is 10, since we're doing m10. So we're going to get 10 squared, which is 100. 100 times 24 would be 2400. And so this simplifies to be k over 2400. So this gives us an abound on the error, but we have to figure out what this k is. And so remembering k here, k was defined to be an upper bound for the second derivative of our function. In this case, our function is going to be e to the x squared. And this is going to be a bound on the interval a to b. Now, if our function, again, is just e to the x squared, we're trying to bound this function's second derivative. The reason we look at the second derivative is because that measures the concavity, which is the critical player in this here. Specifically, the interval a to b, we want to switch that to be a to 1, because we have a specific one in mind. And so let's look at some calculations of our derivative here. We have the zero derivative of just the function itself. The first derivative by the chain rule, we're going to get an e to the x squared, because the derivative of an x potential is itself. And then we're going to multiply that by the inner derivative, the derivative of x squared, which is a 2x. And so we get our first derivative right there, this 2x e to the x squared. For the second derivative, this one's a little bit more involved in the calculation. That's because we have to use the product rule here. We take the derivative of 2x times e to the x squared. And then we're going to take just 2x and times that by the derivative of e to the x squared. Derivative of 2x is simple enough, it's just 2. And we've already taken the derivative of e to the x squared. I mean, that's just above there. And so we get 2x e to the x squared right there. You could factor out a 2 e to the x squared if you want to. I'm just going to take out an e to the x squared and that leaves behind a 2 plus 4x squared, right? The reason why this is significant is sort of the following observation. If you look at the expression e to the x squared, this thing is always a positive function. It's always positive. That is, it's e to the x squared is always, always going to be, is always positive. And it's also when your, when x is positive on the interval zero to one, this is always going to be increasing like so. And then 2 plus 4x squared, this expression right here is also always positive. And when you are on the interval zero to one, this will likewise be an increasing function. So putting this together, both factors are increasing and are positive on this interval. So the product of those things will tell us that this function's increasing as well. We could try to sketch a picture of this, but as our function is increasing, this tells us that the maximum value will occur, the maximum will occur when x is equal to one, the point on the right. And so if we look at f double prime at one, we end up with e to the first times 2 plus 4. That is, we get 6e. And this is the k value we're going to get here. All right, so we want to plug that in above right there. And so the error of our midpoint rule is going to be less than or equal to 6e over 2,400, or e over 400, 6 goes into 24, four times. But we probably prefer an estimate of this kind, of some kind. This number is approximately 0.007. And again, just use a calculator for these estimates right here. So this tells us that our estimate using m10, the error is no worse than 0.007. So our estimate will be accurate to at least two decimal places because this number is smaller than 0.01. And so that kind of helps us out in this estimate here. Don't be a hero. These calculations can be done with the computer or with the software or some kind. You should do that. Particularly, I want you to understand how are these error-bounds calculated because we can use a computer to do the approximation, but we also have to be able to analyze the approximation to know how good it is. And so we can guarantee that the estimate we did before, this 1.46 is accurate to at least two decimal places of accuracy.