TITLE: If $f(x)$ is analytic and non-negative, does convergence of $\int_a^{\infty} f(x)\,dx$ imply $\lim_{x\to\infty} f(x)=0$?
QUESTION [6 upvotes]: It is well known that improper integrals don't have to satisfy $\lim_{x\to\infty} f(x)=0$ in order for $\int_a^{\infty} f(x)\,dx$ to converge, for instance $f(x)=\sin(x^2)$. It is also possible to construct such non-negative $f(x)$, and even continuous and non-negative, by taking $f(x)$ to be $0$ everywhere except for triangular spikes with appropriate converging areas.
I was wondering whether we can get such $f(x)$ which is smooth or even analytic. It seems clear that it should be possible to modify the triangular spikes example and get such a smooth $f(x)$ by using bump functions. However, what if we wish for $f(x)$ to be analytic? Bump functions no longer come to the rescue.
To summarize: does there exist a non-negative $f(x)$ which is analytic in $[a,\infty)$ and such that $\int_a^{\infty} f(x)\,dx$ converges, but such that $f(x)$ does not converge to $0$ at infinity?

REPLY [4 votes]: Here are two related problems that one might want to consider at the same time as this one.

Problem 1. Suppose that $ f $  is continuous on  $ [0,\infty) $  and that the improper integral $ \int_{0}^\infty f(x)\,dx $  converges. Find necessary and sufficient conditions on $ f $  so that  $ f(x) \to 0 $  as  $ x\to \infty .$


Problem 2. Suppose that  $ f $  is Riemann integrable on every bounded interval contained in  $ [0,\infty) $  and that the improper integral  $ \int_{0}^\infty f(x)\,dx $  converges. Find necessary and sufficient conditions on  $ f $  so that  $ f(x) \to 0 $  as  $ x\to\infty $.

The well-known answer to the first problem  is uniform continuity.
An answer to the second problem is given in this elementary paper:

R. B. Kelman and T. J. Rivlin. Conditions for Integrand of an
Improper Integral to be Bounded or Tend to Zero.  The American
Mathematical Monthly. Vol. 67, No. 10 (Dec., 1960), pp. 1019-1022.