Prove $\lim\limits_{n\to\infty}n[\int_a^b f(x)dx-\sum_{k=1}^n f(a+k\frac{b-a}{n})\frac{b-a}{n}]=-\frac{1}{2}(b-a)\int_a^b f'(x)dx$ Assume $f(x)$ is a continuous function on $[a,b]$, and its first-order derivative $f'(x)$ is also continuous on $[a,b]$, prove the identity:
$$\lim\limits_{n\to\infty}n\left[\int_a^b f(x)dx-\sum_{k=1}^n f\left(a+k\frac{b-a}{n}\right)\frac{b-a}{n}\right]=-\frac{1}{2}(b-a)\int_a^b f'(x)\,dx$$
I came across this problem in a generalized form question of my problem sets.
My idea is to use the definition of integral, namely expanding $\int_a^b f(x)\,dx$ into $\lim\limits_{m\to\infty}\sum_{k=1}^m f(\varepsilon_k)\frac{b-a}{m}$, in which $\varepsilon_k\in[a+(k-1)\frac{b-a}{m},a+k\frac{b-a}{m}]$.
But the problem is that there are two limit processes, namely $n\to\infty$ and $m\to\infty$, which are supposed to be separate. Thus, it is not easy to combine $\sum_{k=1}^m f(\varepsilon_k)\frac{b-a}{m}$ with $\sum_{k=1}^n f(a+k\frac{b-a}{n})\frac{b-a}{n}$. Even though somehow these two processes are integrated into one process, I get totally different result of this limit with Lagrange's Mean Value Theorem, by letting $\varepsilon_k=a+(k-\theta)\frac{b-a}{n}$, in which $\theta\in[0,1]$, and choosing $\theta$ differently.
There must be something wrong with my method, but I can not see it(probably it is not legal to integrate these two limit processes?).
I will really appreciate it if you can help to prove this identity or point out the problem in my method!
 A: You are on the right path, but using one partition depending on $n$ suffices. The main trick is to break the interval of integration in pieces of equal length and then compare integrals over small segments against their Riemann approximation.
Maybe this will help you complete your task
\begin{aligned}
n\Big(\int_a^b f(x)dx -\sum_{k=1}^n f\big(a+k\tfrac{b-a}{n}\big)\tfrac{b-a}{n}\Big)&=n\Big(\sum^n_{k=1}\int^{a+k\tfrac{(b-a)}{n}}_{a+(k-1)\tfrac{(b-a)}{n}} f(x)-f\big(a+k\tfrac{b-a}{n}\big)\,dx\Big)\\
&=n\Big(\sum^n_{k=1}\int^{k\tfrac{(b-a)}{n}}_{(k-1)\tfrac{(b-a)}{n}} f(a+u)-f\big(a+k\tfrac{b-a}{n}\big)\,du\Big)\\
&=(b-a)\Big(\sum^n_{k=1}\int^{k}_{k-1} f\big(a+t\tfrac{b-a}{n}\big)-f\big(a+k\tfrac{b-a}{n}\big)\,dt\Big)
\end{aligned}
Here we have used changes of variables $u=x-a$, followed by  $t=\frac{n}{b-a}u$
Using the mean value theorem one obtains
\begin{aligned}
(b-a)\Big(\sum^n_{k=1}\int^{k}_{k-1} f\big(a+t\tfrac{b-a}{n}\big) &-f\big(a+k\tfrac{b-a}{n}\big)\,dt\Big)\\
&=(b-a)\sum^n_{k=1}\int^{k}_{k-1} f'\big(a+(t\theta_t+(1-\theta_t)k)\tfrac{b-a}{n}\big)(t-k)\tfrac{b-a}{n}\,dt\\
&\approx (b-a)\sum^n_{k=1}f'\big(a+k\tfrac{b-a}{n}\big)\Big(\int^{k}_{k-1} (t-k)\,dt\Big)\tfrac{b-a}{n}\\
&=-\frac{b-a}{2}\sum^n_{k=1}f'\big(a+k\tfrac{b-a}{n}\big)\tfrac{b-a}{n}\xrightarrow{n\rightarrow\infty} -\frac{b-a}{2}\int^b_af'
\end{aligned}
where $0<\theta_t<1$ depends on $t$. The approximation need some justification (the uniform continuity of $f'$ will do).
