TITLE: If $|f'(c)|<M$, prove $|\int_{0}^{1}f(x)dx-1/n \sum_{k=0}^{n-1}f(x/n)|<M/n$
QUESTION [5 upvotes]: We have a derivative function $f$ with for every $c$ element of $\mathbb{R}: |f'(c)|<M$. I tried to prove that
prove that $\displaystyle \left|\int_{0}^{1}f(x)\mathrm{d}x-\frac{1}n \sum_{k=0}^{n-1}f\left(\frac{x}n\right)\right|\leq\frac{M}{n}$.
I really have no idea how to start. I'm trying to use integral , derivative, sums ... so my paper is full of definitions but i can't use one. Can someone give me a hint how to start with this question so that i can move on.
I'm really sorry i can't give a proper prove that i have already found but i'm stuck at the beginnin already.

REPLY [5 votes]: Your hypothesis on $f'$ implies that $f$ is Lipschitz
$$|f(x)-f(y)|< M|x-y|\,.$$
You can rewrite the integral splitting the domain in $n$ subinterval of length $1/n$, i.e.
$$\int_0^1 f(x)dx = \sum_{k=0}^{n-1}\int_{\frac{k}{n}}^{\frac{k+1}{n}}f(x)dx\,.$$
So you get
$$\left|\int_{0}^{1}f(x)dx-1/n \sum_{k=0}^{n-1}f(k/n)\right|\leq \sum_{k=0}^{n-1}\left|\int_{\frac{k}{n}}^{\frac{k+1}{n}}f(x)dx-\frac{1}{n}f(k/n)\right|\leq\sum_{k=0}^{n-1}\int_{\frac{k}{n}}^{\frac{k+1}{n}}\left|f(x)-f(k/n)\right|dx\,.$$
Using the Lipschitz property you have
$$\left|f(x)-f(k/n)\right|< M|x-k/n|$$
and since $x\in[k/n,(k+1)/n]$ it follows that
$$\left|f(x)-f(k/n)\right|< M/n\,.$$
So you conclude
$$\left|\int_{0}^{1}f(x)dx-1/n \sum_{k=0}^{n-1}f(k/n)\right|< \sum_{k=0}^{n-1}\int_{\frac{k}{n}}^{\frac{k+1}{n}}\frac{M}{n}dx=\sum_{k=0}^{n-1}\frac{M}{n^2}=\frac{M}{n}\,.$$