The Trapezoidal Rule
The trapezoidal rule averages left and right sums by using trapezoids. Formula, a worked example, a table-based example and the error bound, explained.
The Trapezoidal Rule
The trapezoidal rule formula is Tn = Δx/2 [f(x0) + 2f(x1) + 2f(x2) + … + 2f(xn, 1) + f(xn)], where Δx = (b, a)/n and n is the number of subintervals. This is the one formula you need for a trapezoidal sum: the coefficients form a 1-2-2-…-2-1 pattern. The first and last points are weighted half as much as the interior points, because each interior point is used as the right endpoint of one trapezoid and the left endpoint of the next.
Trapezoidal Rule Formula and the 1-2-2-…-2-1 Pattern
The trapezoidal sum is built from the same partition as left and right Riemann sums. Write the partition points as a = x0 < x1 < … < xn = b, each of width Δx. The trapezoidal rule formula is Tn = Δx/2 [f(x0) + 2f(x1) + 2f(x2) + … + 2f(xn, 1) + f(xn)].
The 1-2-2-…-2-1 pattern is not arbitrary. Each interior point xi is the top-right corner of one trapezoid and the top-left corner of the next, so it appears in two height calculations. The endpoints appear in only one trapezoid each. The factor 1/2 in front of Δx comes from the area formula for a trapezoid: average the two heights, then multiply by the width.
Failure case: If you use the 1-2-2-…-2-1 pattern but forget the Δx/2 factor, you get twice the actual trapezoidal sum. Check your result against the left or right sum for a simple case like f(x) = x from 0 to 1 with n = 1.
Why T<sub>n</sub> = (L<sub>n</sub> + R<sub>n</sub>)/2
The trapezoidal rule is exactly the average of the left Riemann sum Ln and the right Riemann sum Rn, provided you use the same partition for both. Ln = Δx [f(x0) + f(x1) + … + f(xn, 1)]. Rn = Δx [f(x1) + f(x2) + … + f(xn)]. Their average is (Δx/2)[f(x0) + 2f(x1) + … + 2f(xn, 1) + f(xn)], which is Tn.
This relationship holds only when the partition is the same for both sums. If the problem gives you a table where left and right sums use different subinterval widths, the average formula does not apply.
Worked Example From a Function
Approximate ∫02 x2 dx using the trapezoidal rule with n = 4.
Step 1: Compute Δx = (2-0)/4 = 0.5. The partition points are x = 0, 0.5, 1.0, 1.5, 2.0.
Step 2: Evaluate f(x) = x2 at each point: f(0) = 0, f(0.5) = 0.25, f(1) = 1, f(1.5) = 2.25, f(2) = 4.
Step 3: Apply the trapezoidal rule formula. T4 = (0.5/2)[0 + 2(0.25) + 2(1) + 2(2.25) + 4] = 0.25[0 + 0.5 + 2 + 4.5 + 4] = 0.25 × 11 = 2.75.
The exact value is ∫02 x2 dx = [x3/3]02 = 8/3 ≈ 2.6667. The trapezoidal rule overestimates here because f''(x) = 2 > 0 on [0,2] (concave up). For a concave-up function, the trapezoids sit above the curve, causing an overestimate. The actual error is about 0.0833.
Failure case: If you round f(1.5) to 2.2 instead of 2.25, the sum changes, which hides the overestimate. Keep at least three decimal places during intermediate steps.
Worked Example From a Table
When you have only a table of values and no function formula, the trapezoidal rule still works. Use the table's x-values and f(x)-values directly in the formula.
Example: The table below gives the velocity v(t) of a car in meters per second at 2-second intervals. Approximate the distance traveled from t = 0 to t = 10 seconds using the trapezoidal rule.
Worked Example From a Table (Continued)
Step 1: The subintervals are uniform with Δt = 2 seconds. The partition points are t = 0, 2, 4, 6, 8, 10. The trapezoidal rule formula with n = 5 is T5 = (2/2)[v(0) + 2v(2) + 2v(4) + 2v(6) + 2v(8) + v(10)] = 1[0 + 2(8) + 2(15) + 2(20) + 2(18) + 10] = 0 + 16 + 30 + 40 + 36 + 10 = 132 meters.
Compare this with the left Riemann sum L5 = 2[0 + 8 + 15 + 20 + 18] = 2 × 61 = 122 meters, and the right Riemann sum R5 = 2[8 + 15 + 20 + 18 + 10] = 2 × 71 = 142 meters. The trapezoidal sum 132 is exactly the average (122 + 142)/2.
Failure case: If the table has non-uniform intervals, you cannot use a single Δx. Use Tn = Σ (Δxi/2)[f(xi, 1) + f(xi)], where Δxi varies per subinterval. AP exam tables are almost always uniform, but check the x-values before assuming.
Trapezoidal Rule Error Bound
The trapezoidal rule error bound gives the maximum possible difference between Tn and the true integral. From Stewart, Calculus, section 7.7, the bound is |ET| ≤ K(b, a)3 / (12 n2), where K is the maximum of |f''(x)| on [a, b]. OpenStax Calculus Volume 2, section 3.6 uses the same formula with M in place of K.
For the earlier example ∫02 x2 dx with n = 4, f''(x) = 2, so K = 2. The bound is |ET| ≤ 2(2-0)3 / (12 × 42) = 2 × 8 / (12 × 16) = 16 / 192 = 0.0833. The actual error was 0.0833, so the bound is tight here. This happens when f''(x) is constant.
Failure case: Do not mistake the error bound for the actual error. The bound is a worst-case guarantee. For many functions, the actual error is far smaller than the bound. To compute the actual error you need the true integral value, which is rarely available in practice.
When the Trapezoidal Rule Overestimates
The trapezoidal rule overestimates the integral when f''(x) < 0 on [a, b], that is, when the function is concave down. A concave-down curve lies below its secant lines, so the trapezoids (which are straight-line approximations) sit above the curve, producing an overestimate.
Conversely, the trapezoidal rule underestimates the integral when f''(x) > 0 (concave up). The earlier example f(x) = x2 on [0,2] was concave up, but the trapezoidal rule still overestimated. Wait, check: f''(x) = 2 > 0, so the rule should underestimate. Let's verify. The trapezoid for the first subinterval [0, 0.5] goes from (0,0) to (0.5, 0.25). The curve x2 on [0, 0.5] is below the line, so the trapezoid overestimates that piece. But the second subinterval [1.5, 2] has the curve above the line. The net effect depends on the entire shape. The concavity rule is: if f''(x) > 0 everywhere, the trapezoidal rule overestimates. The example f(x) = x2 has f''(x) = 2 > 0 and we got T4 = 2.75 > 2.6667, so it overestimated. The rule is correct: positive second derivative means trapezoidal rule overestimates.
This is the opposite of the midpoint rule, which underestimates for concave-up functions. The two rules bracket the true integral when the function's concavity does not change sign.
What Most Often Goes Wrong
The single most common mistake is forgetting the factor 1/2 in the trapezoidal formula. If you write Tn = Δx [f(x0) + 2f(x1) + … + f(xn)], you get twice the correct sum. Always divide Δx by 2.
The second mistake is assuming the trapezoidal rule is always better than the left or right sum. For a monotonic function with a constant sign of concavity, the trapezoidal rule brackets the true integral with the midpoint rule, but either could be closer depending on the function. Check the error bound to know for sure.
Common Questions
What is the trapezoidal rule formula?
T<sub>n</sub> = Δx/2 [f(x<sub>0</sub>) + 2f(x<sub>1</sub>) + 2f(x<sub>2</sub>) + … + 2f(x<sub>n, 1</sub>) + f(x<sub>n</sub>)], with Δx = (b, a)/n.
How do I compute a trapezoidal sum from a table?
Use the table's x-values as the partition. If the intervals are uniform, apply the formula directly. If non-uniform, compute each trapezoid's area separately using (Δx<sub>i</sub>/2)[f(x<sub>i, 1</sub>) + f(x<sub>i</sub>)] and sum them.
What is the trapezoidal rule error bound?
|E<sub>T</sub>| ≤ K(b, a)<sup>3</sup> / (12 n<sup>2</sup>), where K is the maximum of |f''(x)| on [a, b]. This bound comes from Stewart, Calculus, section 7.7.
Does the trapezoidal rule always give a better approximation than the left or right Riemann sum?
For smooth functions, yes, usually. The trapezoidal rule is the average of left and right sums, so it cancels some of their error. But for functions with sharp corners or discontinuities, the midpoint rule can outperform it.
When does the trapezoidal rule overestimate?
When f''(x) < 0 (concave down) on the interval, the trapezoids lie above the curve, giving an overestimate. When f''(x) > 0 (concave up), the trapezoids lie below the curve, giving an underestimate.