Prove $\lim\limits_{x\to\infty}\frac{1}{x}\int_0^xf(t)dt=a$ Let $f:[0,\infty)\to\mathbb{R}$ continuous and $\lim\limits_{x\to\infty}f(x)=a$. Claim: $\lim\limits_{x\to\infty}\frac{1}{x}\int_0^xf(t)dt=a$.
My try: It is $\int_0^xf(t)dt=F(x)-F(0)$ (because of the fundamentaltheorem of calculus) and $\lim\limits_{x\to\infty}F(x)=ax+b$, because $\lim\limits_{x\to\infty}f(x)=a$.
What can I do next, or do you have an idea how to prove it? Regards
 A: Use L'Hôpital's rule and the fundamental theorem of calculus. There are two cases.
Case 1: $\int_0^\infty f(t)dt = \pm \infty$. In this case, by L'Hôpital's rule and the FTC, $$\lim_{x \to \infty} \frac{1}{x} \int_0^x f(t)dt = \lim_{x \to \infty}\frac{\frac{d}{dx}\int_0^x f(t)dt}{\frac{d}{dx}x} = \lim_{x \to \infty}\frac{f(x)}{1} = a \text{.}$$
Case 2: $\int_0^\infty f(t)dt$ is finite. Then the limit in question is clearly 0, and we must show that $a = 0$ as well. However, if $a \neq 0$, then $f$ is eventually bounded away from 0, and so the improper integral would be infinite (a contradiction).
A: Let us go back to the rigorous definition of the limit and it works straightforwardly. 
For any $\epsilon>0$, there is an $X>0$ such that $\forall x>X$, $|f(x)-a|<\epsilon/2$. For such an $x$, let us compute 
$$\begin{split}
\left\lvert-a+\frac1x\int_0^xf(t)\mathrm dt\right\rvert&=\frac1x\left\lvert-aX+\int_0^Xf(t)\mathrm dt+\int_X^x(f(t)-a)\mathrm dt\right\rvert\\&\leq
\frac bx+\frac1x\int_X^x|f(t)-a|\mathrm dt\quad\left(\text{with}\;b=\left|\int_0^Xf(t)\mathrm dt-aX\right|\right)\\
&\leq\frac bx+\frac{x-X}x\frac\epsilon2\\&\leq\frac{b}x+\frac\epsilon2.\end{split}$$ 
For all $x>2\frac b\epsilon$ we have $\frac{b}x<\frac\epsilon2$. Therefore, for all $x>\max\{X,2\frac b\epsilon\}$, $$\left\lvert\frac1x\int_0^xf(t)\mathrm dt-a\right\rvert<\epsilon.$$
A: You're close: as $\;f\;$ is continuous it has a primitive $\;F\;$ , so
$$\frac1x\int_0^xf(t)dt=\frac{F(x)-F(0)}{x-0}\stackrel{MVT}=F'(c_x)=f(c_x)\;,\;\;c_x\in(0,x)$$
and now just take the limit $\;x\to\infty\;$ ... and be careful (for example, for different $\;x$'s one could possibly get the same $\;c_x\;$ . How do you go around this?)
