Let $f\in C^1[0,\infty)$ such that $f(x)\to 0$ as $x\to\infty$. Prove that $\int_0^\infty f(x)^2\, dx\le \Biggl(\int_0^\infty x^2f(x)^2\, dx\Biggr)^{1/2}\Biggl(\int_0^\infty f'(x)^2\, dx\Biggr)^{1/2}\,.$ Hint: write $f(x)^2=-\int_x^\infty \Bigl(f(t)^2\Bigr)'\, dt$.
So I tried doing this without the hint, as follows:
For ease, all integrals are taken from $0$ to $\infty$. Consider $xf(x)f'(x)$ and integrate by parts with $u=xf(x)$ and $dv=f'(x)dx$. This gives $\int xf(x)f'(x)=\underbrace{xf(x)^2\Bigr|_0^\infty}_A-\int f(x)^2-\int xf(x)f'(x)\,.$ But the term $A$ does not necessarily go to zero, which is a total buzzkill.
I've putzed around with the hint a bit, but it's been fruitless. Any help is appreciated, thanks