Let \(f\) be differentiable on \([0,1]\) and suppose \[ \sup_{0<x<1}|f'(x)|=M<\infty. \] For every positive integer \(n\), prove that \[ \left| \frac1n\sum_{j=0}^{n-1}f(j/n)-\int_0^1 f(x)\,dx \right| \le \frac{M}{2n}. \]
Solution
1. For every \(j=0,\ldots,n-1\) and every\[ x\in\left[\frac jn,\frac{j+1}n\right], \]one has\[ \abs{f(j/n)-f(x)} \leq M\left(x-\frac jn\right). \]
If \(x=j/n\), the inequality is immediate. If \(x>j/n\), the mean value theorem applied to \(f\) on \[ \left[\frac jn,x\right] \] gives some point \(\xi\) between \(j/n\) and \(x\) such that \[ f(x)-f(j/n) = f'(\xi)\left(x-\frac jn\right). \] Since \(0<\xi<1\) whenever the interval is nontrivial, \[ \abs{f'(\xi)}\leq M, \] which gives the claim.
2. For each \(j=0,\ldots,n-1\),\[ \left| \frac1n f(j/n) -\int_{j/n}^{(j+1)/n}f(x)\,dx \right| \leq \frac{M}{2n^2}. \]
Since the interval has length \(1/n\), \[ \frac1n f(j/n) = \int_{j/n}^{(j+1)/n}f(j/n)\,dx. \] Hence, by step 1, \[ \begin{aligned} \left| \frac1n f(j/n) -\int_{j/n}^{(j+1)/n}f(x)\,dx \right| &\leq \int_{j/n}^{(j+1)/n} \abs{f(j/n)-f(x)}\,dx\\ &\leq M\int_{j/n}^{(j+1)/n} \left(x-\frac jn\right)\,dx\\ &= \frac{M}{2n^2}. \end{aligned} \]
3. The total left-endpoint Riemann-sum error satisfies\[ \left| \frac1n\sum_{j=0}^{n-1}f(j/n) -\int_0^1f(x)\,dx \right| \leq \frac{M}{2n}. \]
Decompose the integral over the \(n\) subintervals and apply the triangle inequality together with step 2: \[ \begin{aligned} \left| \frac1n\sum_{j=0}^{n-1}f(j/n) -\int_0^1f(x)\,dx \right| &\leq \sum_{j=0}^{n-1} \left| \frac1n f(j/n) -\int_{j/n}^{(j+1)/n}f(x)\,dx \right|\\ &\leq n\cdot\frac{M}{2n^2}\\ &= \frac{M}{2n}. \end{aligned} \]
4. Q.E.D.
Step 3 is the required estimate.