# If $\int_0^\infty fdx$ exists, does $\lim_{x\to\infty}f(x)=0$?

Are there examples of functions $f$ such that $\int_0^\infty fdx$ exists, but $\lim_{x\to\infty}f(x)\neq 0$?

I curious because I know for infinite series, if $a_n\not\to 0$, then $\sum a_n$ diverges. I'm wondering if there is something similar for improper integrals.

-
$f(x)=\begin{cases} 1 &\text{if } x \in \mathbb Z \\ 0 &\text{otherwise}\end{cases}$? – kennytm Sep 16 '12 at 8:49
The classical Fresnel Integral – y zh Sep 16 '12 at 9:14

It depends on what $\int$ means and what else you know about $f$. Here is a continuous example with limits of Riemann integrals:

Let $h(x)=\max\{1-|x|,0\}$ and set $f(x)=\sum_{n=1}^\infty (-1)^n h(nx-n^2)$. This function has up and down "bumps" around integers that become smaller and smaller in area, but have fixed height.

-
+1. Let me suggest to get rid of the signs, which are not necessary for a counterexample, and to present a function such as $f(x)=\sum\limits_nh(n^2x-n^3)$. – Did Sep 16 '12 at 9:15

Here is one more example: $$f(x)=x\sin (x^4)$$ This is infinitely differentiable unbounded function without limit at infinity but with the finite improper Riemann integral over $\mathbb{R}_+$: $$\int_0^{+\infty}x\sin(x^4)dx=\{t=x^4\}=\frac{1}{4}\int_0^{+\infty}\frac{\sin t}{\sqrt{t}} dt=\frac{1}{4}\sqrt{\frac{\pi}{2}}$$

-

If $\lim_{x\to+\infty}f(x)=l>0$, then $\exists M>0:l-\varepsilon<f(x)<l+\varepsilon\quad \forall x>M$, and so

$$\int_M^{+\infty}f(x)dx>\int_M^{+\infty}(l-\varepsilon)dx=+\infty$$

if $\varepsilon$ is sufficiently small.

-
-1, as this $\operatorname{lim}\neq 0$ doesn't mean $\operatorname{lim}=l>0$, as the other examples show. – Vobo Sep 16 '12 at 9:58
@Vobo: I don't say this, there is an "If" as first word of the answer. Anyway I expect some downvotes. – enzotib Sep 16 '12 at 10:51
So maybe you have a condition for your limit to be $0$. If $\displaystyle\int_0^{+\infty}f(x)dx$ is convergent and $\displaystyle\lim_{x\to +\infty} f(x)$ exists, then this limit is zero. – Philippe Malot Sep 16 '12 at 15:10
@enzotib: Ok, your statement is true, but it doesn't answer the question. – Vobo Sep 16 '12 at 15:36
@Vobo: it at least completes the other answers, none of which points out explicitly that the only possibility is that the limit does not exist. – enzotib Sep 16 '12 at 15:43