TITLE: Characterizing smooth, square-integrable functions on $(0,1]$
QUESTION [5 upvotes]: Is there a simple way to characterize the functions in $C^\infty((0,1])\cap L^2((0,1])$?
That is, given a function $f(t)\in C^\infty((0,1])$, is there a necessary/sufficient condition I can check to see if it's square integrable?  An example of such a function is $f(t)=t^{-1/3}$, which diverges as $t\to0$ but satisfies $\int_0^1 f(t)^2\,dt=3<\infty.$

Notes:  I was hoping to prove something to the effect that $f(t)$ is square integrable if and only if $$\lim_{t\to0} \frac{f(t)^2}{t^p}=L < \infty$$ for some $p>-1$.  This is certainily a sufficient condition by the "limit comparison test" for improper integrals, but I'm not sure if it's necessary.  (But, I also couldn't find a simple counterexample!)

REPLY [2 votes]: Define
$$f(t)= \frac{1}{\sqrt t \sqrt{1+(\ln t)^2}}.$$
Then $\int_0^1 f(t)^2\,dt = \pi/2,$ but
$$\lim_{t\to 0+} \frac{f(t)^2}{t^p}=\infty$$
for all $p>-1.$