Use the trapezoidal rule
A river's cross section
A river's depth is measured every 3 meters across the channel, and the dots show the depths in meters. The area of the cross section is the area under the depth graph.
Left rectangles stand on four subintervals, each 3 meters wide, and each takes its height from the depth at its left end. Their areas add up to \(3(1 + 3 + 5 + 4) = 39\) square meters.
Move the slider. The top of each shape tilts until it joins the depths at both ends. Each shape is then a trapezoid, and its slanted top fits the graph better.
The area of a trapezoid is its width times the average of its two depths. The four areas are 6, 12, 13.5 and 9, and they add up to 40.5 square meters.
The average of two heights
The curve has no numbers. A trapezoid stands on each subinterval, and its top joins the heights at the two ends.
Flatten the tops with the slider. Each slanted top turns about its middle. The area does not change, because the part removed on one side equals the part added on the other.
The flat top is at the average of the two heights, so the area of a trapezoid is its width times that average. The height at a dot between two trapezoids is a side of both.
Notation
Trapezoid \(i\) stands on the subinterval from \(x_{i-1}\) to \(x_i\), and its sides are the heights \(\cy{f(x_{i-1})}\) and \(\cy{f(x_i)}\). Its area is the width times the average of the two heights.
\[\frac{\cy{f(x_{i-1})} + \cy{f(x_i)}}{2}\,\cg{\Delta x_i}\]The trapezoidal sum adds the areas of all the trapezoids.
\[T_n = \sum_{i=1}^{n} \frac{\cy{f(x_{i-1})} + \cy{f(x_i)}}{2}\,\cg{\Delta x_i}\]Each interior height is a side of two trapezoids, so it appears twice, and each end height appears once. If all widths are equal, the common width factors out. Together the left sum and the right sum also count each interior height twice and each end height once, so \(T_n\) is their average.
\[\begin{aligned} T_n &= \frac{\cg{\Delta x}}{2}\big[\cy{f(x_0)} + 2\cy{f(x_1)} + \dots \\ &\qquad + 2\cy{f(x_{n-1})} + \cy{f(x_n)}\big] \\ &= \frac{L_n + R_n}{2} \end{aligned}\]The sum needs a value of \(f\) at every end of a subinterval.
When it fails
The pattern 1, 2, …, 2, 1 holds only when all the subintervals have the same width. With one common width, each height moves to a new place, and the trapezoid corners leave the curve.
The red lines show how far each height moves from the x-value where it was read. Find the area of each trapezoid from its own width instead. Then add the areas.
Example 1: A machine's output
A machine produces material at the rate \(r(t) = t^3\) kilograms per hour for \(0 \le t \le 2\). Use the trapezoidal rule with 4 equal subintervals.
Each subinterval is 0.5 wide. The top of each rectangle tilts until both corners are on the curve.
\[\cg{\Delta t = \frac{2 - 0}{4} = 0.5}\]Substitute the ends of the subintervals, \(t = 0, 0.5, 1, 1.5\) and 2, into \(r(t) = t^3\) to find the heights.
\[\cy{0},\ \cy{\tfrac18},\ \cy{1},\ \cy{\tfrac{27}{8}},\ \cy{8}\]Count each interior height twice, because it is a side of two trapezoids, and each end height once. Multiply the sum by half the width.
\[\begin{aligned} T &= \frac{\cg{0.5}}{2}\Big[\cy{0} + 2\Big(\cy{\tfrac18} + \cy{1} + \cy{\tfrac{27}{8}}\Big) \\ &\qquad + \cy{8}\Big] \end{aligned}\]The estimate is 4.25 kilograms, because a rate in kilograms per hour times a time in hours is an amount in kilograms.
\[\begin{aligned} T &= 0.25\,\big(0 + 2\cdot\tfrac92 + 8\big) \\ &= 0.25\,(17) = 4.25 \end{aligned}\]
Example 2: A medicine dose
A medicine enters the blood at the rate \(c(t) = \dfrac{12}{t + 1}\) milligrams per hour for \(0 \le t \le 3\). Use the trapezoidal rule with 3 equal subintervals.
Each subinterval is 1 wide. The heights at 0, 1, 2 and 3 are 12, 6, 4 and 3.
\[\cg{\Delta t = 1}, \qquad \cy{12},\ \cy{6},\ \cy{4},\ \cy{3}\]A tempting wrong move: Each height is a side of two trapezoids, so count every height twice.
\[\begin{aligned} T &= \tfrac12\cdot 2\,(12 + 6 + 4 + 3) \\ &= 25 \end{aligned}\]The heights 12 and 3 are each a side of only one trapezoid. The three trapezoids have areas 9, 5 and 3.5, which add up to 17.5, so counting the end heights twice gives too much.
Count the interior heights twice and the end heights once. The estimate is 17.5 milligrams.
\[T = \tfrac12\left[\cy{12} + 2(\cy{6} + \cy{4}) + \cy{3}\right] = 17.5\]As a check, add the areas of the three trapezoids.
\[\cb{9} + \cb{5} + \cb{3.5} = 17.5\]
Practice
A table gives the rate at which a boat burns fuel, in gallons per hour, at four times. Use the trapezoidal rule to estimate the fuel burned from \(t = 0\) to \(t = 4\) hours.\[\begin{array}{c|cccc} t & 0 & 1 & 3 & 4 \\ \hline r(t) & 3 & 5 & 4 & 2 \end{array}\]
The widths differ. Find the area of each trapezoid from its own width. Then add the areas.
Solution
The widths of the three subintervals are 1, 2 and 1. The area of each trapezoid is its width times the average of its two heights.
\[\begin{aligned} \cg{1}\cdot\frac{\cy{3} + \cy{5}}{2} &= 4 \\ \cg{2}\cdot\frac{\cy{5} + \cy{4}}{2} &= 9 \\ \cg{1}\cdot\frac{\cy{4} + \cy{2}}{2} &= 3 \end{aligned}\]Add the areas. The boat burns about 16 gallons.
\[\cb{4} + \cb{9} + \cb{3} = 16\]
Questions
The figure shows depths 1, 4, 6, 5 and 2 at \(x = 0, 2, 4, 6\) and 8, with four trapezoids of equal width.
Which heights does the trapezoidal sum count twice?
- 4, 6 and 5, the interior heights
- All five heights
- 1 and 2, the end heights
- None of them
Answer
4, 6 and 5, the interior heights
What is the area of the trapezoid from \(x = 2\) to \(x = 4\)?
- 10
- 20
- 8
Answer
10
Let \(f(x) = x^2 + 2x\). What is the trapezoidal sum for \(\int_0^4 f(x)\,dx\) with 2 equal subintervals?
- 40
- 32
- 64
Answer
40
Summary
The trapezoidal rule multiplies each subinterval's width by the average of its two end heights, then adds the products.
This works because the top of each trapezoid joins both end heights, so it follows the curve better than a flat top.
You use it when a function or a table gives the heights at the ends of the subintervals, with equal or unequal widths.
This is one of five skills in topic 6.2 of Which & Why: AP Calculus.