# $f$ real-valued, continuously differentiable, then $(\int |f|^2\,dx)^2 \le 4(\int |xf(x)|^2\,dx)(\int |f'|^2\,dx)$? [duplicate]

If $f$ is real-valued and continuously differentiable on $\mathbb{R}$, do we have the following inequality:$$\left(\int |f|^2\,dx\right)^2 \le 4\left(\int |xf(x)|^2\,dx\right)\left(\int |f'|^2\,dx\right)?$$

By integration by parts, $$\int f^2(x)\,dx=xf^2(x)-\int x(f^2(x))'\,dx=xf^2(x)-2\int xf(x) f'(x)\,dx.$$ If $\lim_{x\to\pm\infty} xf(x)^2 = 0$ then the inequality easily follows by using Cauchy–Schwarz inequality. $$\left(\int_{-\infty}^{+\infty} f^2(x)\,dx\right)^2=4\left(\int_{-\infty}^{+\infty} (xf(x))\cdot f'(x)\,dx\right)^2\\\leq 4\left(\int_{-\infty}^{+\infty} (xf(x))^2\,dx\right)\cdot\left(\int_{-\infty}^{+\infty} (f'(x))^2\,dx\right).$$