Trapezoid Sum with Shortcuts
The trapezoid sum is a good one to have some shortcuts for. We'll call the trapezoid sum with n sub-intervals TRAP(n).
Here's our favorite shortcut: TRAP(n) is the average of LHS(n) and RHS(n).
These rectangles are, respectively a left-hand sum and a right-hand sum!
Remember that the trapezoid sum is the average of the left- and right-hand sums. However, there's an even shorter way to get a trapezoid sum out of your calculator.
LHS(n) = [f(x0) + f(x1) + ... + f(xn – 1)]Δx
RHS(n) = [f(x1) + ... + f(xn – 1) + f(xn)]Δx.
The trapezoid sum is the average of the right- and left-hand sums, so
This is kind of a mess. It gets better if we factor out the Δx:
Now look carefully at what we have inside the parentheses. The quantities f (x0) and f (xn) only show up once each, because f (x0) is only used in the left-hand sum and
f (xn) is only used in the right-hand sum:
However, every term from f(x1) to f(xn – 1) is used in both the left-hand sum and right-hand sum, so each of these terms will show up twice each.
If we're estimating the area between f and the x-axis on [a, b] with TRAP(n) the first thing we do is divide [a, b] up into n equal sub-intervals and find the endpoints.
The value f(x0) is only used as a height of the left-most trapezoid. Similarly, the value f(xn) is only used as a height of the right-most trapezoid. However, the value of f at every endpoint in between these shows up in two trapezoids.
When we add the areas of all these trapezoids we get
Factoring out the and the Δx gives us
Now we have a much better way to find a trapezoid sum:
- Divide the interval into sub-intervals.
- Find the value of f at each endpoint.
- Multiply each value by 2 unless it's the value of f at one of the original endpoints.
- Add everything up, divide by 2, and multiply by the width of a sub-interval.