TITLE: Proving that $\lim\limits_{n\to\infty}n\left( \int_0^1 f(t)\, dt -\frac1n\sum_{k=0}^{n-1}f\left(\frac k n\right) \right)=\frac{f(1)-f(0)}{2}$
QUESTION [9 upvotes]: Let $f\in C^2([0,1])$. Prove that $$ \lim_{n\to+\infty}n\left( \int_0^1
 f(t)\, dt -\frac1n\sum_{k=0}^{n-1}f\Big(\frac k n\Big) 
 \right)=\frac{f(1)-f(0)}{2}. $$

The second term is clearly the Riemann sum of the function $f$; since the function $f$ is integrable (it is continuous) $\displaystyle \frac1n\sum_{k=0}^{n-1}f\Big(\frac k n\Big)$ converges to $\displaystyle\int_0^1 f(t)\, dt$ when $n \to + \infty$. 
So we have an indeterminate form, "$\infty \cdot 0$". How can we start? I thought we should use Taylor expansion ($f$ is $C^2$) but I cannot see how. Would you please help me? 
Thanks in advance.

REPLY [7 votes]: Using the Taylor series for $f$, we get
$$
\begin{align}
&n\left(\int_0^1f(t)\,\mathrm{d}t-\frac1n\sum_{k=0}^{n-1}f(k/n)\right)\\
&=n\sum_{k=0}^{n-1}\int_{k/n}^{(k+1)/n}\left(f(t)-f(k/n)\right)\,\mathrm{d}t\\
&=n\sum_{k=0}^{n-1}\int_{k/n}^{(k+1)/n}\left(f'(k/n)(t-k/n)+O(1/n^2)\right)\,\mathrm{d}x\\
&=n\sum_{k=0}^{n-1}\left(f'(k/n)\frac1{2n^2}+O(1/n^3)\right)\\
&=\frac12\sum_{k=0}^{n-1}f'(k/n)\frac1n+O(1/n)\tag{1}
\end{align}
$$
Where the $O(1/n)$ term has constant bounded by the maximum of $\frac12|f''(t)|$ on $[0,1]$.
Since the sum in $(1)$ is the Riemann Sum for $\frac12\int_0^1f'(t)\,\mathrm{d}t$, we have
$$
\begin{align}
\lim_{n\to\infty}n\left(\int_0^1f(t)\,\mathrm{d}t-\frac1n\sum_{k=0}^{n-1}f(k/n)\right)
&=\lim_{n\to\infty}\left(\frac12\sum_{k=0}^{n-1}f'(k/n)\frac1n+O(1/n)\right)\\
&=\frac12\int_0^1f'(t)\,\mathrm{d}t+0\\
&=\frac{f(1)-f(0)}{2}\tag{2}
\end{align}
$$