# Prove that $\lim_{n\rightarrow\infty} \frac{1}{n}\sum_{k = 1}^{n}{f(\frac{k}{n}) }$ $=\int_0^1 f(x)dx.$

Question:

Let $f$ be continuous on $[0,1]$. Prove that

$\lim_{n\rightarrow\infty} \frac{1}{n}\sum_{k = 1}^{n}{f(\frac{k}{n}) }$ $=\int_0^1 f(x)dx.$

where $k=0,1,...,n.$

Attempt:

I don't even know where to start. It makes sense reading the sum, as $k\rightarrow n$, and dividing it by the number of partitions, I should reach the definition of the integral. Hoping for a little push to get started.

• Well, what is the definition of integral [you're using]? – Grigory M May 8 '14 at 22:45
• @Brian AFAICS Martin answered the question completely a couple of months ago, no? – Grigory M May 8 '14 at 22:51

## 6 Answers

A continuous function on a compact set is uniformly continuous.

Given an $\epsilon\gt0$, find an $N$ so that if $|x-y|\le\frac1N$ we have $|f(x)-f(y)|\le\epsilon$. Thus, for any $n\ge N$, $$\int_{\large\frac{k-1}n}^{\large\frac kn}\left|\,f\left(\frac kn\right)-f(x)\,\right|\,\mathrm{d}x\le\frac\epsilon{n}$$ Therefore, for $n\ge N$, \begin{align} \left|\,\sum_{k=1}^nf\left(\frac kn\right)\frac1n-\int_0^1f(x)\,\mathrm{d}x\,\right| &=\left|\,\sum_{k=1}^n\left(\int_{\large\frac{k-1}n}^{\large\frac kn}f\left(\frac kn\right)\,\mathrm{d}x-\int_{\large\frac{k-1}n}^{\large\frac kn}f(x)\,\mathrm{d}x\right)\,\right|\\ &\le\sum_{k=1}^n\int_{\large\frac{k-1}n}^{\large\frac kn}\left|\,f\left(\frac kn\right)-f(x)\,\right|\,\mathrm{d}x\\[6pt] &\le\epsilon \end{align}

• Dear robjohn, (while the answer is technically correct) the result has nothing to do with uniform continuity — the statement is true even if $f$ is not cont. (as long as the RHS exists). – Grigory M May 8 '14 at 22:48
• @GrigoryM: $\int_0^1\log(1-x)\,\mathrm{d}x$ exists, but the sum does not since $\log(1-x)$ does not exist at $x=1$. – robjohn May 8 '14 at 22:52
• Well, yes, if Riemann integral exists (in your example not Riemann integral, but only improper integral exists). – Grigory M May 8 '14 at 22:55
• @GrigoryM: Certainly, if a function is bounded on a bounded domain, and its set of discontinuities is a null set (a set of measure zero), then the function is Riemann Integrable. However, the standard proof is usually done with continuous functions on compact sets, then generalized by using compact intervals where the function is continuous, whose complement is arbitrarily small. Since the domain is a compact interval and the function is given as continuous, why not use these facts to prove convergence? – robjohn May 8 '14 at 23:35

It is exactly as you say. The limit on the left is a limit of Riemann sums of $f$ in the interval $[0,1]$.

Since $f$ is continuous, it is Riemann integrable, so by definition for each $\varepsilon>0$ there exists a partition $P$ such that for all partitions $P'=\{0=x_1<x_2<\dots<x_N=1\}$ which are finer than $P$ we have $$\sum_{k=1}^N \max_{x\in [x_{k-1},x_k]}f(x) \cdot (x_{k}-x_{k-1}) -\int _0^1 f(x) dx<\varepsilon$$ and $$\int _0^1 f(x) dx -\sum_{k=1}^N \min_{x\in [x_{k-1},x_k]}f(x) \cdot (x_{k}-x_{k-1})<\varepsilon$$ The partition $\{0,1/n,2/n,\dots,(n-1)/n,1\}$, $x_k=k/n$ will be finer than $P$ for large $n$, and since in this case we have $x_{k}-x_{k-1} =k/n- (k-1)/n= 1/n$, we have $$\sum_{k=1}^n \max_{x\in [x_{k-1},x_k]}f(x) \frac{1}{n} -\int _0^1 f(x) dx<\varepsilon$$ and $$\int _0^1 f(x) dx -\sum_{k=1}^n \min_{x\in [x_{k-1},x_k]}f(x) \frac{1}{n}<\varepsilon$$ Now, also observe that $$\min_{x\in [x_{k-1},x_k]}f(x)\leq f(k/n)\leq \max_{x\in [x_{k-1},x_k]}f(x)$$ and combining this with the above inequalities you obtain $$\left|\sum_{k=1}^n f(k/n) \frac{1}{n} -\int _0^1 f(x) dx \right|<\varepsilon$$ which is true for large $n$. This gives you the result.

• To me, the question seems to be to show that if $f$ is continuous on $[0,1]$, then it is Riemann Integrable. If we assume that it is Riemann Integrable in the first place, then the answer follows simply from the definition of Riemann Integrability. – robjohn May 8 '14 at 23:33
• That could be true, but then the question should be phrased as "show that the limit exists". – Dimitris May 9 '14 at 2:01
• It appears as if you are using the Darboux integral rather than the Riemann integral. It turns out that a function is Riemann integrable if and only if it is Darboux integrable. However, Riemann integrability is ostensibly weaker and proofs using it as an assumption are a bit more involved. – robjohn May 9 '14 at 2:42

Continuity of $f$ plays no rôle in this game, we only have to assume that the Riemann integral $\int_a^b f(x)\>dx$ exists.

For a function $f:\ [a,b]\to{\mathbb R}$ and a subinterval $Q\subset[a,b]$ write $$|\Delta f|_Q:=\sup_{x\in Q} f(x)-\inf_{x\in Q} f(x)\ .$$ Such a function is Riemann integrable over $[a,b]$ if for any $\epsilon>0$ there is a partition $P$ of $[a,b]$ into subintervals $Q_k=[x_{k-1}, x_k]$ $\>(1\leq k\leq N)$ such that $$D_P(f):=\sum_{k=1}^N |\Delta f|_{Q_k}(x_k-x_{k-1})<\epsilon\ .$$ When $f$ passes this simple test then there is a unique number $S\in{\mathbb R}$ such that $$|R_P-S|\leq D_P(f)\tag{1}$$ for all partitions $P$ and all Riemann sums $R_P=\sum_{k=1}^N f(\xi_k)(x_k-x_{k-1})$ computed using $P$. This $S$ is called the integral of $f$ over $[a,b]$, and is denoted by $\int_a^b f(x)\ dx$.

The following Lemma has been proved several times on MSE: When $f$ is integrable over $[a,b]$ then for each $\epsilon>0$ there is $\delta >0$ such that $D_P(f)<\epsilon$ as soon as $\max_{1\leq k\leq N}(x_k-x_{k-1})<\delta$.

We now argue as follows: Given an $\epsilon>0$ choose a $\delta>0$ according to the Lemma. There is an $n_0$ such that ${b-a\over n_0}<\delta$. Denote the partition considered in the question by $P_n$ and the displayed Riemann sum by $R_n$. When $n>n_0$ then ${b-a\over n}<\delta$. Therefore it follows from the principle $(1)$ that $$\left|R_n-\int_a^b f(x)\ dx\right|\leq D_{P_n}(f)< \epsilon\ .$$

$f(x) =f(0)+\frac{f'(0)x}{1!}+\frac{f''(0)x^2}{2!}+.....=\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n$

$$\int _0^x {f(t) dt}=\int _0^x(\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} t^n)dt=\sum_{n=0}^{\infty} (\frac{f^{(n)}(0)}{n!}\int _0^x t^n dt)=\sum_{n=0}^{\infty} (\frac{f^{(n)}(0)}{n!}\frac{x^{n+1}}{n+1})$$ $$\int _0^x {f(t) dt}=\sum_{n=0}^{\infty} \frac{f^{(n)}(0)x^{n+1}}{(n+1)!}$$ $$(1)$$

$$f(\frac{kx}{n})=\sum_{m=0}^{\infty} \frac{f^{(m)}(0)}{m!} (\frac{kx}{n})^m$$ $$\sum \limits_{k=1}^{n} k^m=\frac{n^{m+1}}{m+1}+a_mn^m+....+a_1n=\frac{n^{m+1}}{m+1}+\sum \limits_{j=1}^m a_jn^j$$ where $a_j$ are constants. More information about summation http://en.wikipedia.org/wiki/Summation

$$\lim_{n\to\infty} \frac{x}{n}\sum \limits_{k=1}^n f(\frac{kx}{n})=\lim_{n\to\infty} \frac{x}{n}\sum \limits_{k=1}^n \sum_{m=0}^{\infty} \frac{f^{(m)}(0)}{m!} (\frac{kx}{n})^m=\lim_{n\to\infty} \frac{x}{n}\sum_{m=0}^{\infty} \frac{x^m}{n^m} \frac{f^{(m)}(0)}{m!} \sum \limits_{k=1}^n k^m=\lim_{n\to\infty} \frac{x}{n}[f(0)n+\frac{f'(0)x}{n 1!}(\frac{n^2}{2}+\frac{n}{2})+ \frac{f''(0)x^2}{n^2 2!}(\frac{n^3}{3}+\frac{n^2}{2}+\frac{n}{6})+\frac{f'''(0)x^3}{n^3 3!}(\frac{n^4}{4}+\frac{n^3}{2}+\frac{n^2}{4})+\frac{f^{(4)}(0)x^4}{n^4 4!}(\frac{n^5}{5}+\frac{n^4}{2}+\frac{n^3}{3}-\frac{n}{30})+...... ]= \lim_{n\to\infty} [f(0)x+\frac{f'(0)x^2}{n^2 1!}(\frac{n^2}{2}+\frac{n}{2})+ \frac{f''(0)x^3}{n^3 2!}(\frac{n^3}{3}+\frac{n^2}{2}+\frac{n}{6})+\frac{f'''(0)x^4}{n^4 3!}(\frac{n^4}{4}+\frac{n^3}{2}+\frac{n^2}{4})+\frac{f^{(4)}(0)x^5}{n^5 4!}(\frac{n^5}{5}+\frac{n^4}{2}+\frac{n^3}{3}-\frac{n}{30})+...... ]= [f(0)x+\frac{f'(0)x^2}{ 2!}+ \frac{f''(0)x^3}{ 3!}+\frac{f'''(0)x^4}{ 4!}+\frac{f^{(4)}(0)x^5}{ 5!}+...... ]$$

$$\lim_{n\to\infty} \frac{x}{n}\sum \limits_{k=1}^n f(\frac{kx}{n})=\sum_{m=0}^{\infty} \frac{f^{(m)}(0)x^{m+1}}{(m+1)!}$$ $$(2)$$

Equation $(1)$ and equation $(2)$ are equal to each other. Thus

$$\lim_{n\to\infty} \frac{x}{n}\sum \limits_{k=1}^n f(\frac{kx}{n})=\int _0^x {f(t) dt}$$

• You are assumning that $f$ is $C^ \infty$. The result is true even for just continuous functions. – Georgy May 14 '14 at 9:36

The first thing I notice is that we will be multiplying by zero as the current formula stands (constant divided by infinity is zero). But, intuitively, we can not say the integral of the two parts will be zero. This leads me to thinking of rewriting the sum using some formula. In fact, if we prove this formula, we have our answer!