# Show $\lim\limits_{n\rightarrow\infty}n\left(\frac{1}{n}\sum_{i=1}^{n}f\left(\frac{i}{n}\right)-\int_{0}^{1}f(x)dx\right)=\frac{f(1)-f(0)}{2}$

Show that if $f$ is continuously differentiable on $[0,1]$, then $$\lim\limits_{n\rightarrow\infty}n\left(\frac{1}{n}\sum_{i=1}^{n}f\left(\frac{i}{n}\right)-\int_{0}^{1}f(x)dx\right)=\frac{f(1)-f(0)}{2}$$

Observe that \begin{align*} \lim\limits_{n\rightarrow\infty}n\left(\frac{1}{n}\sum_{i=1}^{n}f\left(\frac{i}{n}\right)-\int_{0}^{1}f(x)dx\right)&=\lim\limits_{n\rightarrow\infty}n\left(\frac{1}{n}\sum_{i=1}^{n}f\left(\frac{i}{n}\right)-\sum_{i=1}^{n}\int_{(i-1)/n}^{i/n}f(x)dx\right)\\ &=\lim\limits_{n\rightarrow\infty}n\left(\sum_{i=1}^{n}\int_{(i-1)/n}^{i/n}\left[f\left(\frac{i}{n}\right)-f(x)\right]dx\right)\\ &=\lim\limits_{n\rightarrow\infty}n\left(\sum_{i=1}^{n}\int_{(i-1)/n}^{i/n}f'(c_i)\left[\left(\frac{i}{n}\right)-x\right]dx\right) \end{align*} where the last equality follows from the Mean Value Theorem.

Let $m_i=\inf\{f'(x):x\in[(i-1)/n,i/n]\}$ and $M_i=\sup\{f'(x):x\in[(i-1)/n,i/n]\}$, then we have the follow inequality: $$m_i\int_{(i-1)/n}^{i/n}\left[\left(\frac{i}{n}\right)-x\right]dx\leq\int_{(i-1)/n}^{i/n}f'(c_i)\left[\left(\frac{i}{n}\right)-x\right]dx\leq M_i\int_{(i-1)/n}^{i/n}\left[\left(\frac{i}{n}\right)-x\right]dx$$

Consequently $$\frac{1}{2n}\sum_{i=1}^{n}m_i\leq n\sum_{i=1}^{n}\int_{(i-1)/n}^{i/n}f'(c_i)\left[\left(\frac{i}{n}\right)-x\right]dx\leq\frac{1}{2n}\sum_{i=1}^{n} M_i$$ where $\int_{(i-1)/n}^{i/n}\left[\left(\frac{i}{n}\right)-x\right]dx=\frac{1}{2n^2}$.

I stuck at this step. And it seems not right because when I take the limit both sides, I have $0$. Can someone give me a hint or suggestion. Thanks in advanced.

• You can't just write $f'(c_i)$, since $c_i$ depends on $x$ - it is a different value for each $x$. – Thomas Andrews Dec 23 '15 at 0:39
• @ThomasAndrews that equality wrong? – Simple Dec 23 '15 at 0:52
• Yes, your application of the mean value theorem is wrong - otherwise, every function is linear if there is a $c\in (a,b)$ such that $f(x)-f(a)=f'(c)(x-a)$ for all $x\in(a,b)$. – Thomas Andrews Dec 23 '15 at 0:55
• @ThomasAndrews Can you give me a suggestion to modify it? – Simple Dec 23 '15 at 1:07
• Possible duplicate of Limit with Integral and Sigma – Paramanand Singh Jun 13 '16 at 5:49

$$\frac{1}{2n} \sum_{i=1}^{n} m_i \quad \text{and} \quad \frac{1}{2n} \sum_{i=1}^{n} M_i$$

converge to the same quantity, namely $\frac{1}{2}(f(1) - f(0))$. This is essentially because they are Riemann sums for $\frac{1}{2}f'(x)$.

Proof using Taylor Theorem. Let $x_i = i/n$ for brevity and consider $F(x) = \int_{0}^{x} f(t) \, dt$. Then we may write

$$n \left( \frac{1}{n} \sum_{i=1}^{n} f(x_i) - \int_{0}^{1} f(x) \, dx \right) = n \sum_{i=1}^{n} (F(x_{i-1}) - F(x_i) + \tfrac{1}{n}F'(x_i)).$$

By Taylor Theorem, we can pick $c_i \in [x_{i-1}, x_i]$ such that

$$F(x_{i-1}) = F(x_i - \tfrac{1}{n}) = F(x_i) - \tfrac{1}{n}F'(x_i) + \tfrac{1}{2n^2}F''(c_i).$$

Plugging this back, we have

$$n \left( \frac{1}{n} \sum_{i=1}^{n} f(x_i) - \int_{0}^{1} f(x) \, dx \right) = \frac{1}{2n} \sum_{i=1}^{n} f'(c_i).$$

Taking $n \to \infty$, this converges to $\frac{1}{2}(f(1) - f(0))$ as desired.

Hint: Use Taylor's theorem and write the following: $$f(x) = f(\frac{i}{n}) +f'(\frac{i}{n})(x-\frac{i}{n})+h_i(x)(x-\frac{i}{n})$$, where $h_i(x)$ is a continuous function that has a limit 0 at $x = \frac{i}{n}$. The rest should be a matter of computation.

• I don't know the Taylow's theorem yet – Simple Dec 23 '15 at 1:08
• Then, I think the answer by @sangchul lee serves the purpose. – dezdichado Dec 23 '15 at 3:12


which yields \begin{align} &n\bracks{{1 \over n}\sum_{i = 1}^{n}\mathrm{f}\pars{{i \over n}} - \int_{0}^{n}\mathrm{f}\pars{{x \over n}}\,\dd x} = {\mathrm{f}\pars{1} - \mathrm{f}\pars{0} \over 2} + {\mathrm{f}'\pars{1} - \mathrm{f}'\pars{0} \over 12n} + R_{+}\pars{\mathrm{f},2} \end{align}

Then, \begin{align} \color{#f00}{\lim_{n \to \infty}n\bracks{% {1 \over n}\sum_{i = 1}^{n}\mathrm{f}\pars{{i \over n}} - \int_{0}^{1}\mathrm{f}\pars{x}\,\dd x}} & = \color{#f00}{{\mathrm{f}\pars{1} - \mathrm{f}\pars{0} \over 2}} \end{align}

whenever the remaining term $R_{+}\pars{\mathrm{f},2}$ vanishes out ( see the above cited link ) in the $n \to \infty$ limit.