For , the composite trapezoidal rule is
With this becomes
Write the requested right Riemann sum as . The trapezoidal endpoint correction for a right Riemann sum gives
The integrand is continuous on , so the trapezoidal values converge to its definite integral; the endpoint correction tends to zero. Therefore