# Prove that $\lim_{n \rightarrow \infty} \frac{1}{n}\int^n_0xf(x)dx = 0$

Let $f(x) \geq 0$ be continuous on the interval $[0, \infty)$, and suppose that $\int_0^\infty f(x)dx < \infty$. Prove that $\displaystyle \lim_{n \rightarrow \infty} \frac{1}{n}\int^n_0xf(x)dx = 0$

I want to use some version of dominated convergence theorem somewhere, and I have that the integral is equal to $\displaystyle \int_0^1nyf(ny)dy$ using change of variables. Some help would be great. Thanks.

Put $$g_n(x) = \frac{x}{n} f(x) \chi_{[0,n]}(x)$$ Then $$\frac{1}{n}\int_0^n xf(x) dx = \int_{0}^\infty g_n(x) dx$$ Also, $|g_n(x)| \leq |f(x)| = f(x)$ for all $x$, and $g_n(x) \rightarrow 0$ pointwise. Therefore the dominated convergence theorem applies, and \begin{align} \lim_{n \rightarrow \infty} \frac{1}{n}\int_0^n xf(x) dx &= \lim_{n \rightarrow \infty} \int_{0}^\infty g_n(x) dx\\ &= \int_{0}^{\infty} \lim_{n \rightarrow \infty}g_n(x) dx \\ &= 0 \end{align}
Let $I_k = \int_{k}^{k+1} f(x) \, dx$; note that by the integrability assumption, S:= $\sum_{k\ge 0} I_k < \infty$. We may bound $$0\le \int_{k}^{k+1} x f(x) \, dx < (k+1) I_k$$ Thus, $$0\le \frac{1}{n}\int_{0}^{n} xf(x) \, dx < \frac{1}{n}\left(I_{0} + 2I_{1} + 3I_{2} + \cdots + n I_{n-1} \right)$$ Now, let $S_k = I_{0} + \cdots + I_{k-1} = \int_{0}^{k} f(x) \, dx$. We may rewrite the upper bound as $$\frac{1}{n} \left( S_n + (S_n - S_1) + (S_n - S_2) + \cdots + (S_n - S_{n-1}) \right)= S_n - \frac{S_1 + \cdots + S_{n-1}}{n}$$ Since $S_n \to S$ and $(S_1 + \cdots + S_{n-1})/n \to S$ as $n\to\infty$, it follows that the upper bound goes to zero as $n\to \infty$. By squeezing, we're done.