TITLE: Under what conditions do we have $\int_{0}^{\infty} |f(x)|^2 dx \leq C \int_{0}^{\infty} x^2 |f^{\prime}(x)|^2 dx$?
QUESTION [5 upvotes]: I have been trying to prove the inequality 

$$\int_{0}^{\infty} |f(x)|^2 dx \leq C \int_{0}^{\infty} x^2 |f^{\prime}(x)|^2 dx$$

for some constant $C$, under the most general set of assumptions possible. Obviously we need to have that $f$ is square-integrable and differentiable.
I can prove a version of the inequality with $C=4$, provided that additionally $x |f(x)|^2 \to 0$ as $x\to \infty$ (the proof is by integration by parts and the Cauchy-Schwartz inequality). Can this be improved? Thank you.

REPLY [7 votes]: Constant is $\boldsymbol{\le4}$
Whatever conditions are needed to justify the following steps:
$$
\begin{align}
\int_0^\infty|f(x)|^2\,\mathrm{d}x
&=\int_0^\infty\left|\int_x^\infty f'(t)\,\mathrm{d}t\right|^2\,\mathrm{d}x\tag1\\
&\le\int_0^\infty\int_x^\infty t^{-3/2}\,\mathrm{d}t\int_x^\infty t^{3/2}|f'(t)|^2\,\mathrm{d}t\,\mathrm{d}x\tag2\\
&=\int_0^\infty2x^{-1/2}\int_x^\infty t^{3/2}|f'(t)|^2\,\mathrm{d}t\,\mathrm{d}x\tag3\\
&=\int_0^\infty t^{3/2}|f'(t)|^2\int_0^t2x^{-1/2}\,\mathrm{d}x\,\mathrm{d}t\tag4\\
&=\int_0^\infty t^{3/2}|f'(t)|^24t^{1/2}\,\mathrm{d}t\tag5\\
&=4\int_0^\infty t^2|f'(t)|^2\,\mathrm{d}t\tag6
\end{align}
$$
Explanation:
$(1)$: Funamental Theorem of Calculus (assuming $f$ vanishes at $\infty$)
$(2)$: Cauchy Schwarz
$(3)$: integrate
$(4)$: change order of integration
$(5)$: integrate
$(6)$: simplify
It seems that if $(6)$ exists and $f$ vanishes at $\infty$, the inequality holds.

$\boldsymbol{4}$ is Sharp
Define
$$
f_a(t)=\frac{t^{-1/2}}{t^{-a}+t^a}\tag7
$$
then
$$
\begin{align}
\int_0^\infty f_a(t)^2\,\mathrm{d}t
&=\int_0^\infty\frac{t^{-1}}{\left(t^{-a}+t^a\right)^2}\mathrm{d}t\tag8\\
&=\int_0^\infty\frac{t^{2a-1}}{\left(1+t^{2a}\right)^2}\mathrm{d}t\tag9\\
&=\frac1{2a}\int_0^\infty\frac1{(1+t)^2}\mathrm{d}t\tag{10}\\[6pt]
&=\frac1{2a}\tag{11}
\end{align}
$$
Explanation:
$\phantom{1}(8)$: apply $(7)$
$\phantom{1}(9)$: multiply numerator and denominator by $t^{2a}$
$(10)$: substitute $t^{2a}\mapsto t$
$(11)$: evaluate
Taking the derivative of $(7)$
$$
f_a'(t)=\frac{t^{-\frac32+a}\left(4a+(1-2a)\left(1+t^{2a}\right)\right)}{2\left(1+t^{2a}\right)^2}\tag{12}
$$
Thus,
$$
\begin{align}
\int_0^\infty t^2f_a'(t)^2\,\mathrm{d}t
&=\int_0^\infty t^2\,\left(\frac{t^{-\frac32+a}\left(4a+(1-2a)\left(1+t^{2a}\right)\right)}{2\left(1+t^{2a}\right)^2}\right)^2\mathrm{d}t\tag{13}\\
&=\int_0^\infty\frac{t^{-1+2a}\left(4a+(1-2a)\left(1+t^{2a}\right)\right)^2}{4\left(1+t^{2a}\right)^4}\,\mathrm{d}t\tag{14}\\
&=\int_0^\infty\frac{16a^2+8a(1-2a)(1+t)+(1-2a)^2(1+t)^2}{8a(1+t)^4}\,\mathrm{d}t\tag{15}\\[3pt]
&=\frac23a+\frac12(1-2a)+\frac1{8a}(1-2a)^2\tag{16}\\[6pt]
&=\frac16a+\frac1{8a}\tag{17}
\end{align}
$$
Explanation:
$(13)$: apply $(12)$
$(14)$: simplify
$(15)$: substitute $t^{2a}\mapsto t$
$(16)$: integrate
$(17)$: simplify
The ratio of $(11)$ over $(17)$ is $\frac4{1+\frac43a^2}$. As $a\to0$, this gets arbitrarily close to $4$.