# Is there a continuous positive function whose integral over $(0,\infty)$ converges but whose limit is not zero?

Is there a continuous positive function whose integral over $(0,\infty)$ converges but whose limit is not zero?

closest I could think of is the Riemann or tent functions. but they are defined as $0$ in an endless number of points. I am looking for a function that is greater than $0$

does that even exists?

• Take your tent functions and add, for example, $e^{-x}$. This sum would be strictly positive and integrable. Commented Jan 26, 2012 at 17:26
• Note that if these is a limit, it has to be zero. Commented Jan 26, 2012 at 17:28
• Thanks guys!! really helpfull! :)
– YNWA
Commented Jan 26, 2012 at 18:30

Yes, there is such a function:

Consider the function $f$ with domain $[0,\infty)$ whose graph coincides with the non-negative $x$-axis except around the positive integers. At a positive integer $n$, the graph of $f$ is a "spike" (an inverted V shape) of height one and width $1/2^{n-1}$, centered around $n$. These are your "tent" functions.

Now, following Jose27's comment, take $g(x)=f(x)+e^{-x}$.

Then $\limsup\limits_{x\rightarrow\infty}\ g(x)=1$, because of the spikes, while $\liminf\limits_{x\rightarrow\infty}\ g(x)=0$; thus $\lim\limits_{x\rightarrow\infty} g(x)$ does not exist.

Also:

$$\int_0^\infty e^{-x}\,dx= 1$$ and $$\int_0^\infty f(x)\, dx =\sum_{n=1}^\infty {1\over 2^n }=1.$$ Thus, the integral $\int_0^\infty g(x)\,dx$ converges to 2.

Finally, note that $g$ is continuous and $g(x)=e^{-x}+f(x)\ge e^{-x}>0$ on $[0,\infty)$.

• oh my god! thats it...thanks to everybody...your the best!
– YNWA
Commented Jan 26, 2012 at 18:27
• Best example ever. Commented Aug 24, 2017 at 2:31
• Great example: just what I was looking for. This shows that there do in fact exist continuous probability density functions do not tend to 0 as x tends to + (or -) infinity . Commented Mar 26, 2020 at 0:03
• @AdamRubinson Worth noting though that while the probability density does not tend to $0$, the complement of the cumulative density function does. In other words, $\lim_{x\to\infty}P(X\geq x)=0$. I think. Commented Sep 1, 2023 at 7:58