Divide into equal subintervals of width , with . Linear interpolation between adjacent values of gives a trapezoid of signed area . Adding these areas produces the composite trapezoidal rule
For continuous , this tends to the integral as ; if has a bounded continuous second derivative, the error is at most .
The original PDF prints while using as the bound summation index and as the upper limit. Literally this does not specify a varying upper limit. Interpreting the intended limit as , and relabelling the summation index , gives the right Riemann sum
For , , and , the only difference from the composite trapezoidal rule is the endpoint weighting: . Hence