Some question about Riemann integral. Consider the $S_{n} = \int_{a}^{b}f(x)dx - \frac{b-a}{n}\sum f(a+k \frac{b-a}{n})$. Prove that $nS_{n} \to \frac{(b-a)(f(b)-f(a))}{2}$. Of course $f \in C[a,b]$
My attempt: we could get some partition in integral and say that there is a point $\xi \in (x_{0} , x_{0}+x)  : \int_{x_{0}}^{x_{0}+x}f(t)dt = f(\xi) \triangle_{[x_{0},x+x_{0}]}$ for any segment. So will have in limit:
$ \displaystyle\lim_{n \to \infty} nS_{n} = (b-a) \lim_{n \to \infty} \sum_{k = 0}^{n} (f(\xi_{i}) - f(a+k \frac{b-a}{n}))$
But how can we estimate difference of functions in sum?
 A: If $f$ is continuously differentiable, apply the mean value theorem to obtain 
$$\begin{align}nS_n &= n\sum_{k=1}^n\int_{x_{k-1}}^{x_k}\left[f(x) - f(x_k)\right] \, dx \\ &= n\sum_{k=1}^n\int_{x_{k-1}}^{x_k}f'(\xi_{k,n})(x - x_k) \, dx \end{align}$$
where $x_k = a + (b-a)k/n$, and $\xi_{k,n} \in (x, x_k) \subset [x_{k-1}, x_k].$
Defining
$$M_{k} = \sup \{f'(x): x_{k-1} \leqslant x \leqslant x_k \}, \\ m_{k} = \inf \{f'(x): x_{k-1} \leqslant x \leqslant  x_k \}. $$
we get the bounds
$$n \sum_{k=1}^nm_{k}\int_{x_{k-1}}^{x_k}(x - x_k) \, dx  \leqslant nS_n \leqslant n \sum_{i=1}^nM_{k}\int_{x_{k-1}}^{x_k}(x - x_k) \, dx.  $$
Note that
$$\int_{x_{k-1}}^{x_k}(x - x_k) \, dx  = -\frac{1}{2}\left(x_{k-1} - x_k \right)^2 = - \frac{(b-a)^2}{2n^2},$$
and
$$-\frac{b-a}{2}\underbrace{\frac{b-a}{n}\sum_{k=1}^nm_{k}}_{\text{ lower sum}} \leqslant nS_n \leqslant -\frac{b-a}{2}\underbrace{\frac{b-a}{n}\sum_{k=1}^nM_{k}}_{\text{upper sum}}. $$
Now take the limit as $n \to \infty$.  The upper and lower Riemann (or Darboux) sums indicated above converge to the integral of $f'$ and by the squeeze theorem
$$\lim_{n \to \infty} nS_n = - \frac{b-a}{2} \int_a^bf'(x) \, dx = \frac{(b-a)(f(a)-f(b))}{2}$$
