# Square integrable function that doesn't go to zero?

I'm reading through some elementary quantum mechanics textbooks and a few authors mention that "there exist pathological functions that are square-integrable but do not go to zero at infinity." (Griffiths)

I am having trouble coming up with one, does anybody have an example?

The only one I can think of is the dirac distribution (which isn't even a function...):

• Since integration ignores point discontinuities, the function $f(x)=1$ for $x$ integer and $f(x)=0$ for all other $x$ provides a simple example. May 7, 2013 at 23:28
• This post looks somewhat related. physicsforums.com/showthread.php?p=1781128 May 7, 2013 at 23:33
• There are those that are continuous, even. Let $f$ have a graph consisting of an infinite number of spikes ("centered" on the integers, say) of height $1$ such that the widths of the spikes are small enough so that $f$ is in $L_2$. May 7, 2013 at 23:33
• Why do people consider these examples 'pathological'? May 7, 2013 at 23:38

Consider the function: $$x^2\exp(−x^8 \sin^2 x)$$

I found it in this article: http://arxiv.org/abs/quant-ph/9907069. More specifically on page 7.

• I cleaned up the $\LaTeX$, and fixed a typo in the definition of the function ($\sin^2 x$ was incorrectly copied as $\sin(2x)$, resulting in a function that isn't $L^2$.) Jun 1, 2013 at 13:20
• Thanks mate! I gotta learn TeX! Jun 1, 2013 at 13:23
• There's a brief intro here. Jun 1, 2013 at 13:27
• Do you know what the square integral is by any chance? Or the $L^2$ norm (norm squared) of the state I mean. Dec 6, 2016 at 18:51

As David and proximal have pointed out in the comments, there are many square-integrable functions which do not go to $0$ in the limit, even continuous ones. However, we do have the following:

Suppose $f : \mathbf R \to \mathbf R$ is uniformly continuous, and $f\in L^p$ for some $p\geq 1$. Then $|f(x)|\to 0$ as $|x| \to \infty$.

Along the lines of David Mitra's comment, try $$f = \sum_{n=1}^\infty 1_{[n, n + 2^{-n}]}.$$ That is, $f(x) = 1$ if $x$ is in one of the intervals $[1,1+1/2], [2, 2+1/4], [3, 3+1/8], \dots$, and $f(x) = 0$ otherwise. Clearly $f(x)$ does not approach 0 as $x \to \infty$, since for any $N$ there are $x \ge N$ with $f(x) = 1$ and other $x \ge N$ with $f(x) = 0$. But on the other hand, it's easy to compute that $\int f^2 = \sum_{n=1}^\infty 2^{-n} = 1$.

With a little more work you can make this function continuous, or even $C^\infty$.