Riemann sums from section 4.32