I've often seen people use the inequality $$\int_{\mathbb R^3} \frac{|u(x)|^2}{|x|^2}\,dx \leq 4\int_{\mathbb R^3}|\nabla u(x)|^2\,dx,\qquad u\in C_0^\infty(\mathbb R^3) $$ without proof, refering to it as "Hardy's inequality".
I struggled to find a direct proof of this in the literature and couldn't prove it myself. Does anyone know a straightforward proof of this or a book in which Hardy's inequality in this form is proved?
I would also be interested in the general form of this inequality, i.e. what happens if one replaces $\mathbb R^3$ with $\mathbb R^n$?
This is in Evans' PDE book, page 296 in the second edition. The following discussions on this proof may also be useful,
However, it doesn't seem like the constant 4 is explicitly computed in Evans, and moreover it may be improved if the domain of $u$ is not convex. In the dimension 1 variant, it is optimal, and you can refer to Computing the best constant in classical Hardy's inequality. In higher dimensions, you may want to look at this paper On the best constant for Hardy's inequality in $\mathbb R^n$ by Marcus, Mizel and Pinchover, and its references.