# finding examples for a non negative and continuous function for which the infinite integral is finite but the limit at infinity doesn't exist

Question:

a. Find an example for a non-negative and continuous function s.t. $\int _0^\infty f(x)dx$ is finite but the following limit doesn't exist: $\lim_{x\to \infty} f(x)$.

b. Is it possible that $\int _0^\infty f(x)dx$ is bounded but $f(x)$ is not bounded?

What we did with A: We suggested the function $|sin(x^2)|$ which has periods that get smaller and smaller until they no longer imply on the sum. But since it's a trig function it doesn't have a determinate limit. Wolfram didn't have the integral value for that func, and we were wondering if it really converges and if it is really a good example.

What we did with B: We thought about the function: $f(x)= { x\in \Bbb N },{e^{-x} \notin \Bbb N }$ and we had a disagreement whether f(x) is integrable. I said no because similarly to Dirichlet function, one sum's limit will be 0 while the other one's will be infinite. My partner said that if I find a $\delta<1$ then the definition of Riemann's integral does hold and so this integral is equal to that of $f(x)=e^{-x}$ She was trying to say this functions integral will be 0, but still it won't be bounded. I disagreed. Who's right?

For (b), and therefore (a), let $f(x)=0$ with the following exceptions. For every positive integer $n$, $f(x)$ climbs linearly from $f(x)=0$ at $x=n-2^{-2n}$ to $f(x)=2^n$ at $x=n$, then falls linearly to $0$ at $x=n+2^{-2n}$.

The area of the triangle "at" $n$ is $(2^{-2n})(2^n)$, that is, $2^{-n}$, and the sum of the areas of these triangles is $1$.

• I love that example! – Asaf Karagila Oct 29 '13 at 7:46
• Amazing :-) Huge thanks. Could you please answer the following questions: 1. How do we make sure that this function is integrable using Riemann's definition (the only one we've learned by now)? 2. Do you have any negative/positive thoughts about our suggestions? – jreing Oct 29 '13 at 11:58
• If you look at the definition of Riemann integral, the interval must be finite. So here we are dealing with an improper integral, for which we must extend the Riemann integral definition. But it is easy to see that $I(M)=\int_0^M f(x)\,dx$ exists, in the Riemann sense, for any $M$, since the function is continuous and that $\lim_{M\to\infty} I(M)=1$. So the improper integral exists. – André Nicolas Oct 29 '13 at 16:07
• Your argument with B) would be OK for improper integral, except that probably the condition "continuous" mentioned in A) probably is also meant to apply. Then you would have to fix your example by putting "bumps" at the integers, like in my answer, instead of spikes, as in your suggestion. As to what you tried with A), there is a way to manipulate the sine function, but if we let $I(M)=\int_0^M|\sin(x^2)|\,dx$, then $\lim_{M\to\infty}I(M)$ does not exist, the improper integral diverges. – André Nicolas Oct 29 '13 at 16:18
• What happens if we require the function to be differentiable? – WhySee Jan 16 '18 at 8:40

For A: The function $x \mapsto |\sin x^2|$ is not integrable. Since it is periodic, and the integral over a period is positive, it follows that the integral is infinite.

For B: Assuming that you meant $f(x) = \begin{cases} x, & x \in \mathbb{N} \\ e^{-x}, & x \notin \mathbb{N} \end{cases}$, then $f$ is not continuous, but it is integrable and unbounded. (And yes, the integral of $f$ is the same as the integral of $x \mapsto e^{-x}$.)

Here is a simple example that satisfies all requirements at the same time:

Let $\phi(x) = \max(0, 1-|x|)$. Let $f_n(x) = n\phi(n^3(x-n))$. Note that $\int f_n = \frac{1}{n^2}$.

Let $f=\sum_{n=2}^\infty f_n$. Note that $f(n) = n$ for all $n \ge 2$, $\int f = \sum_{n=2}^\infty \frac{1}{n^2}$, and $f(n+\frac{1}{2}) = 0$ for $n \ge 2$.

Hence $f$ is continuous, unbounded, integrable and has no limit as $x \to \infty$.