6

Is there a continuous function such that $\int_0^{\infty} f(x)dx$ converges, yet $\lim_{x\rightarrow \infty}f(x) \ne 0$?

I know there are such functions, but I just can't think of any example.

luka5z
  • 6,571
  • 6
    Think of a function that is mostly zero but which has peaks at each $x = n$ enclosing areas of the size $1/n^2$. – Friedrich Philipp Mar 04 '16 at 21:00
  • 5
    $f(x)=\sin(x^2)$, see Fresnel integrals. – Wojowu Mar 04 '16 at 21:00
  • 1
    The examples so far are about integrable functions which do not have a (pointwise) limit as $x$ tends to infinity. It seems that in case $f(x)$ has a non-zero limit the integral does not exist. – Urgje Mar 04 '16 at 21:13
  • @Urgje Indeed, if $\lim_{x\to+\infty}f(x)=\ell\neq0$, then for all $0<\varepsilon<|\ell|/2$, there exists $M>0$ such that for all $x>M$ we have $|f(x)-\ell|<\varepsilon$, so that $|f(x)|>|\ell|-\varepsilon>|\ell|/2$, so $\int_{]M,+\infty[}|f(x)|\mathrm{d}x>\int{_{]M,+\infty[}}|\ell|/2\mathrm{d}x= + infty $, and then $f$ is not Lebesgue integrable on $]0,+\infty[$. – Nicolas Mar 04 '16 at 21:41
  • Related: https://math.stackexchange.com/questions/1623364 – Watson Jan 26 '17 at 17:39

2 Answers2

10

Here is a picture (not very accurate, I know), to see how to construct a counter-example:

$\qquad\qquad\qquad$enter image description here

The $n$-th triangle centered at $x=n$ have basis of length $1/n^2$. This is Friedrich Philipp's idea.

Watson
  • 24,404
  • 3
    If we want we can write the function as $$f(x) = \sum_{n=2}^\infty\chi_{[n-c_n,n]}\frac{(x-n+c_n)}{c_n} + \chi_{[n,n+c_n]}\frac{(n+c_n-x)}{c_n}$$ where $c_n = \frac{1}{n^2-1}$ and $\chi_A(x) = 1$ if $x\in A$ and $0$ otherwise. However I think this a good example of a situation where a picture is much better than an explicit formula. – Winther Mar 28 '16 at 05:08
  • I should have written "This is Friedrich Philipp's idea (in an above comment)", to be clearer. – Watson Jul 11 '17 at 12:35
6

Let $$ f(x)=\begin{cases}n^2(x-n),&\ x\in[n,n+1/n^2], \\ -n^2x+n^3+2,&\ x\in[n+1/n^2,n+2/n^2]\\ 0,&\ x\in[n+2/n^2,n+1) \end{cases} $$ Then $f$ is continuous, $f(x)\geq0$ for all $x$, and $$ \int_0^\infty f(x)\,dx=\sum_{n=1}^\infty\frac1{n^2}=\frac{\pi^2}6. $$ Note also that, by pushing this idea, we can get $f$ to be unbounded (by making the triangles thin quicker and get higher).

Martin Argerami
  • 217,281