Find an example of an unbounded continuous function $f : [0, \infty) \to \mathbb{R}$ that is nonnegative and such that $\int_0^\infty f < \infty$.

real-analysisriemann-integration

Find an example of an unbounded continuous function $f : [0, \infty) \to \mathbb{R}$ that is nonnegative and such that $\int_0^\infty f < \infty$. Note that this means that $\lim_{x \to \infty} f(x)$ does not exist; compare previous exercise. Hint: on the interval $[k, k+1]$, $k \in \mathbb{N}$, define a function whose integral over this interval is less than say $2^{-k}$.

I guess the hint indicates that $\int_0^\infty f= \sum_{k=0}^\infty \int_k^{k+1} f(x) < \sum_{k=0}^\infty 2^{-k} < \infty$. But, I cannot find $f(x)$ such that $\int_k^{k+1} f(x) < 2^{-k}$, but limit does not exists. Could you provide one?

Best Answer

Define

$$f_k(x)=\begin{cases} k &\text{if } k\leq x \leq k+\frac{2^{-k}}{k} \\ 0\text{ otherwise} \end{cases}$$

Then define

$$f(x)=\sum_{i=1}^\infty f_i(x)$$

Then

$$\int_0^\infty f(x)dx=\int_0^{\infty}\sum_{i=1}^\infty f_i(x)=\sum_{i=1}^\infty \int_k^{k+\frac{2^{-k}}{k}}k=\sum_{i=1}^\infty 2^{-i}=1<\infty$$


EDIT Added the continuity condition.

Define

$$g_k(x)=\begin{cases} \frac{2^{-k-1} (x-k)}{k^2} &\text{if } k\leq x \leq k+\frac{2^{-k-1}}{k} \\ \frac{k^4+2^{-k-1} k (k-x)+2^{-2 (k+1)}}{k^3} &\text{if } k+\frac{2^{-k-1}}{k}\leq x \leq k+\frac{2^{-k}}{k} \\ 0\text{ otherwise} \end{cases}$$

Basically, these are just triangles that are under $f_k(x)$ that start at the beginning of the step function around $x=k$, hit the middle of the top of the step, and go back to the end of the step. This implies

$$g_k(x)\leq f_k(x)$$

Then for

$$g(x)=\sum_{k=1}^\infty g_k(x)$$

we have

$$g(x)=\sum_{i=1}^\infty g_i(x)\leq \sum_{i=1}^\infty f_i(x)<\infty$$

Since $g(x)$ is continuous, we are done.