Give an example of $f$ that is $C^\infty$, $\int_0^\infty f(t)dt$ converges but $f$ does not converge.

Today, my teacher asked about a real function that was integrable, but such that $\displaystyle\lim_{t\to \infty}f(t)\neq 0$ ($f$ need not have a limit).

It's easy to forge an example: a function that has tightening spikes each with areas $1/n^2$ does the trick.

He then asked for a real $C^\infty$ function that was integrable, but such that $\displaystyle\lim_{t\to \infty}f(t)\neq 0$ ($f$ need not have a limit).

One heuristic argument is to take the previous function and "smoothen" the spikes. However, he referred to a nicer function that can be defined explicitely.

Do you have an idea ? I've looked for something involving $\sin,\cos,\tan$

• Are you familiar with standard bump functions? See en.wikipedia.org/wiki/Bump_function – guest196883 Jun 10 '14 at 18:33
• @SamDeHority Yes, what do you plan on doing with them ? – Gabriel Romon Jun 10 '14 at 18:34
• Does "integrable" refer to Riemann or Lebesgue? – Daniel Fischer Jun 10 '14 at 18:41
• @DanielFischer Riemann I guess ($\int_0^\infty f(t)$ converges) – Gabriel Romon Jun 10 '14 at 18:42
• In that case, cnick's answer gives an explicit example. – Daniel Fischer Jun 10 '14 at 18:43

why not something like $f(x) = \sin(x^2)$? It has to oscillate faster as you go towards infinity so that it adds/subtracts less and less area each time in order for the integral to converge.
$$h:x\mapsto \begin{cases} e^{-\frac{1}{x}} &\text{if }x>0\\ 0&\text{if }x\leq 0 \end{cases}$$
which is very useful for constructing $C^\infty$ functions with that kind of properties.