Definition · The trapezoid and midpoint sumsWith the pieces of the earlier lessons and width h, the trapezoid sum is Tₙ = (Lₙ + Rₙ)/2, equivalently the sum over pieces of h·(f(left) + f(right))/2.
The midpoint sum is Mₙ = h·(f(m₁) + … + f(mₙ)), where mₖ is the middle of the kth piece.
On the square t² over the interval from 0 to 1 with four pieces, the earlier lessons found L₄ = 7/32 and R₄ = 15/32. The average is T₄ = (7/32 + 15/32)/2 = 11/32. The lab's total is 1/3, and 11/32 − 1/3 = 1/96: the trapezoid sum is high, because the rate curves upward and the chord lies above the curve.
The midpoints of the four pieces are 1/8, 3/8, 5/8, 7/8, and the squares of those are 1, 9, 25, 49 over 64. So M₄ = (1/4)·(1 + 9 + 25 + 49)/64 = 84/256 = 21/64. Switch the rule control to midpoints and the lab prints 21/64 with error −1/192. The midpoint sum is low, by half as much as the trapezoid sum is high.
t² on [0, 1] sum error (sum − 1/3)
T₄ 11/32 1/96
T₈ 43/128 1/384
M₄ 21/64 −1/192
M₈ 85/256 −1/768
T error ratio: (1/96)/(1/384) = 4
Theorem · Both errors are fixed multiples of the square of the widthFor t² on the interval from 0 to 1, Tₙ − 1/3 = h²/6 and Mₙ − 1/3 = −h²/12, where h = 1/n.
Take one piece from x to x + h. The total over it is ((x + h)³ − x³)/3 = h·(x² + xh + h²/3), which is the claim the lab confirms on the whole interval at 1/3; the next lesson, “The Antiderivative and the Fundamental Theorem”, shows where it comes from. The trapezoid contributes h·(x² + (x + h)²)/2 = h·(x² + xh + h²/2), which exceeds it by h·h²/6 = h³/6. The midpoint contributes h·(x + h/2)² = h·(x² + xh + h²/4), which falls short by h³/12.
Neither excess depends on x, so over n pieces they add to n·h³/6 and −n·h³/12; with n·h = 1 that is h²/6 and −h²/12. Halving h divides both by exactly 4.
□
That is the exact ratio of 4 the lab prints: T₄ and T₈ have errors 1/96 and 1/384. The proof is for the square; the lab does not extend it to other rates, and the ratio for a cubic is a separate computation.
Exact for straight lines, and not for what bends
The trapezoid rule uses both ends, which makes it tempting to think it is exact whenever it has enough information. It is exact for every straight-line rate; on a curve it is exact only by accident, and on t² it is high by h²/6 at every n. The quartic preset, t⁴ on the interval from 0 to 1, makes the same point and adds a refinement. Its trapezoid errors are 53/2560 at n = 4 and 213/40960 at n = 8, and their ratio is 848/213, about 3.98122. It approaches 4 and is not 4.
A cubic is kinder: on t³ over the interval from 0 to 1 the trapezoid errors are exactly 1/64, 1/256, 1/1024 for n = 4, 8, 16, and the ratio is exactly 4. Type the cubic into the rate box and read it. On every quadratic and cubic rate the trapezoid error is a fixed multiple of h², so whenever that error is not already zero its ratio is exactly 4; t⁴ is the first power whose error is not such a multiple.