 Hello and welcome to the screencast in which we're going to work an example of the trapezoid rule. Here's our problem. We want to integrate e to the x cubed between negative 1 and 1 using the trapezoid rule with three subintervals. So the first thing I'll do here is what I do for any sort of approximation. That is set up a little bit of notation. In particular, I really want a name for the function I'm going to integrate. So I'll call it f of x, that's e to the x cubed. And the other thing I want to know is delta x. That's the width of the subintervals. The usual formula for this is b minus a over n. And so in this case, that's 1 minus negative 1 over 3. Be careful with the negative there, which comes out to two-thirds. So that says I'm going to have trapezoids that are two-thirds wide here. Now that I have that, I'm going to draw the endpoints of those trapezoids on my x-axis. And then I'm actually going to draw the trapezoids. This will help with figuring out the formula so that you don't have to memorize it. And also getting a graphical sense of what we're working with. So my left-hand endpoint is negative 1, which means my next endpoint is delta x to the right. Well, negative 1 plus two-thirds comes out to negative one-third. And this distance right here is delta x. So I added that two-thirds on right there. Another delta x to the right gets me up to positive one-third. And then the last delta x gets me all the way up to one. So now I've got the edges, the endpoints of my trapezoids drawn. And I'm going to zoom in a little bit here so that we can focus on drawing these trapezoids. So here's what I'm going to be doing. I'm going to draw these trapezoids. And I'm going to draw their left and right-hand edges first, because those edges go from each of our endpoints that we just wrote down all the way up to the function. So, for example, the one at negative one looks just like that. The one at negative one-third goes straight up there. And the one at one-third goes up to the function again too. Keep in mind that unlike the left or right-hand rule, every one of our edges goes all the way up to the function. The last one on one here goes way up all the way to the edge of our graph. Next, I'm going to actually connect these. Since we're drawing trapezoids, we're not going to do rectangles. We're actually going to connect the top edges of these. So the first trapezoid on the left here will go just like this, where I've connected those edges. And now I've got this trapezoid right here, which will contribute area to my trapezoidal sum. The next trapezoid goes like this. And the last trapezoid has a very steep edge. It goes like this. I'll shade each of those in so that we can see the total area that we're talking about right here. So this whole area that I'm shading in right now is what the trapezoidal sum represents. Alright, having taken a look at that, we're ready to actually calculate the trapezoidal sum. So let's do that. The trapezoidal sum is easiest to write out if you've drawn this picture already. So we call it Tn, or in this case T3, and it's just the sum of the areas of the trapezoid. Well, the area of a trapezoid is one-half times the sum of its bases, times its width. Well, in this case, you might have to look at things a little bit sideways because each of these bases is actually what it looks like, the sides of the trapezoid. So I've just drawn this in red right here so that we can refer to it by color. Remember, the bases of a trapezoid are parallel, and so those bases are going to be the vertical lines right here. So I'll write those in in red. The height of the left-hand edge is what we call f of negative one. I'm not going to write out the function's name, e to the x cubed, just f. Add to that the right-hand edge, which is f of negative one-third tall. And then we need to multiply by the height of the trapezoid. Well, the height goes from one parallel base to the other. So that's this distance back and forth along the x-axis. We also have a name for that. That's delta x. All right, and that's the area of our first trapezoid. The next one, we'll do the same thing, one-half times the sum of the bases times the height. This one I'll do in blue. So again, we're going to have the left-hand edge be f of negative one-third this time. And the right-hand edge is going to be f of one-third. And the height, again, is going to be between those parallel bases, and that's delta x. And I'll write in the value later. Finally, we're going to do the right-most trapezoid, one-half times the sum of the bases. And I'll do this one in green. So the left-hand edge is going to be right here. And the right-hand edge is going to be right here. And writing those out, we get f of one-third plus f of one. And again, the height is along the x-axis, and it's delta x. So now it's time to actually write this out using the function. So we have one-half f of negative one, well, that's e to the negative one cubed, which is just e to the negative one. And f of negative one-third is e to the negative one-third cubed. And I'm not going to simplify that. I'm going to leave that until later. Delta x, we know, that's two-thirds. So simplifying the other ones quickly now, e to the negative one-third cubed, notice how I get the same value a few times. That's because each of these trapezoids shares an edge, so we're going to use the same height over and over. And again, delta x is two-thirds. The last trapezoid. And e to the one cubed is e to the one times the height. So this is our value. And now at this point, we can evaluate this by any means. I used a calculator. Using the calculator, this comes out to approximately 2.3629. So that's our estimate for the value of the integral. And I can even write that here. That's approximately the value of the integral from negative one to one of e to the x cubed dx. Take a look back, make sure you know where all of these geometric ideas came from, where each of the function values and heights came from. And then on the next page, we're going to take a look at another way to view this. All right, if you've already calculated a left and a right-hand sum, there's another easier way to calculate the trapezoid rule. And that is as the average of the left-hand and right-hand sums. So I've already done the left-hand and right-hand sums for you here and drawn them out using Geogebra. So take a look at those. You can see the left-hand sum is an underestimate, all the boxes are beneath it. The right-hand sum is an overestimate, in fact a very big overestimate in some places. And these are their values. Well, the trapezoid sum with the same number of boxes is equal to the left-hand sum plus the right-hand sum divided by 2, so their average, which in this case is 1.5795 plus 3.1464 all divided by 2. And again, if you do this out with a calculator and I've rounded slightly here, we get 2.3629, which is exactly the value we got on the last page. So the trapezoid rule can be calculated from the left and right-hand rule, which can save you a lot of time if you've already got those. The last screen I'm going to show you shows all three of these rules together. There's a lot of colors here, but the red one is just another picture of the left-hand sum. The blue one is another picture of the right-hand sum. And the green one is the trapezoid rule, and you can see how the green one's top edges are diagonal, and they run right between the open space between the left-hand and right-hand boxes. So each right-hand and left-hand box has some space between them, and the trapezoid rule cuts that space in half. That's a visual representation of why the trapezoid rule is the average of the two. It takes up half the space between them, and it's often a much better approximation, as you can see from the green lines that follow the picture much better here.