Join neighbouring points with straight lines instead of flat tops. Enter f(x), the interval and n to get Tₙ with every trapezoid drawn, the weighted table and the actual error.
Each slice is a trapezoid whose area is the average of its two side heights times the width, 2f(xi−1)+f(xi)Δx. Adding them, every interior point is counted twice, which gives the 1, 2, 2, …, 2, 1 weights.
The trapezoidal rule is exactly the average of the left and right Riemann sums: Tn=2Ln+Rn.
Error bound: if ∣f′′(x)∣≤K on [a,b], then ∣ET∣≤12n2K(b−a)3. Doubling n cuts the error by about 4.
For a concave-up function the straight tops lie above the curve, so Tn overestimates. For concave-down it underestimates.
Tn=2Δx[f(x0)+2f(x1)+⋯+2f(xn−1)+f(xn)] with Δx=nb−a and xi=a+iΔx.
How do I find the error bound for the trapezoidal rule?
Find K, the largest value of ∣f′′(x)∣ on [a,b]; then ∣ET∣≤12n2K(b−a)3. To guarantee an error below ε, choose n≥12εK(b−a)3.
Is the trapezoidal rule more accurate than the midpoint rule?
Usually not. For smooth functions the midpoint error is about half the trapezoidal error and of the opposite sign, which is why Simpson’s rule, S2n=32Mn+Tn, is so accurate.
Can I use the trapezoidal rule with a table of data?
Yes, with equally spaced x-values: multiply 2Δx by (first value + last value + twice every value in between). For unequal spacing, add each trapezoid separately.
Does the trapezoidal rule over- or underestimate?
Overestimates where the graph is concave up (f′′>0) and underestimates where it is concave down.