Question: > 
> If $f:[0,{\infty})\to\mathbb R$ continuous and $\lim\_{x\to\infty} f(x)=a$.
>  Show that:
>  $$
> \lim\_{x\to\infty} \frac1x\int\_{0}^{x} f(t)\ \mathsf dt = a.
> $$
> 
> 
> 

If:
$$
\lim\_{x\to\infty} \frac1x \int\_{0}^{x}\ f(t)=
 \lim\_{x\to\infty} \frac{1}{x} (F(x)-F(0))\ \mathsf dt$$

and $F(0)$ is some constant, all I need to show is $F(x)= xa$. 

This is where I am not sure how I should continue, if I what I did is correct, how should I continue?

Answer: 
Let $\varepsilon > 0$. Since $\lim\limits\_{x\to \infty} f(x) = a$, there exists $M > 0$ such that $|f(x) - a| < \varepsilon$ for all $x \ge M$. So for $x > M$,

$$\left|\frac{1}{x}\int\_0^x f(t)\, dt - a\right| \le \frac{1}{x}\int\_0^M |f(t) - a|\, dt + \frac{1}{x}\int\_M^x |f(t) - a|\, dt < \frac{C}{x} + \frac{\epsilon(x - M)}{x},$$

where $C = \int\_0^M |f(t) - a|\, dt$. Hence

$$\limsup\_{x\to \infty}\left|\frac{1}{x}\int\_0^x f(t)\, dt - a\right| \le \varepsilon.$$

Since $\varepsilon$ was arbitrary, the result follows.
**METHOD 1:**

[L'Hospital's Rule](https://en.wikipedia.org/wiki/L%27H%C3%B4pital%27s_rule) comes to the rescue.

$$\begin{align}
\lim\_{x\to \infty}\frac{\int\_0^x f(t)\,dt}{x}&=\lim\_{x\to \infty}\frac{d}{dx}\int\_0^x f(t)\,dt\\\\
&=\lim\_{x\to \infty}f(x)=a
\end{align}$$

---

**METHOD 2:**

If one does not wish to appeal to L'Hospital's Rule, then another approach is to take a similar way forward to that of the OP. Here, we don't show that $F(x)=xa$. 

Rather, we recognize that for any $\epsilon >0$, there is a number $L$ such that for $x>L$, $a-\epsilon<f(x)<a+\epsilon$. Then, we can write for such a fixed $L$

$$\left|\frac1x\int\_0^xf(t)\,dt-a\right|\le\frac1x\int\_0^L|f(t)-a|\,dt+\frac1x\int\_L^x|f(t)-a|\,dt \tag 1$$

The first integral on the right-hand side of $(1)$ goes to zero as $x\to \infty$ while the second integral is less than $\epsilon$. And the proof is complete.