Unclear integration by parts of function $f\in L^2$ I came across this mathematical statement while investigating on Fourier analysis and $L^2$ spaces. I need some clarification on why the first term isn't taken into consideration. Originating from this article http://www-users.math.umn.edu/~garrett/m/fun/uncertainty.pdf, Paul Garett. Firstly, it states that through integration by parts the following statement can be said for a function $f\in L^2$.
$$\int{|f(x)|^2dx}=-\int{x(|f(x)|^2)'dx}$$
Logically this originates from
$$\int{|f(x)|^2dx}=x|f(x)|^2-\int{x(|f(x)|^2)'dx}$$
However, I don't understand why the first term was taken into consideration, thanks.
 A: I am not fully convinced that the author isn't cheating somewhere, though as I was writing I think I've got his point. Notice that if $f\in L^2$, then $\liminf_{\lvert x\rvert\to\infty} \lvert x\rvert\lvert f(x)\rvert^2=0$, therefore there are sequences $x_n\to \infty$ and $y_n\to-\infty$ such that $x_k\lvert f(x_k)\rvert^2\to 0$ and $y_k\lvert f(y_k)\rvert^2\to 0$. Thus, \begin{align}&\int_{\Bbb R}\lvert f(x)\rvert^2\,dx=\lim_{k\to\infty} \int_{y_k}^{x_k} \lvert f(x)\rvert^2\,dx=\\&=\lim_{k\to\infty} x_k\lvert f(x_k)\rvert^2-y_k\lvert f(y_k)\rvert^2-\int_{y_k}^{x_k}x(\lvert f(x)\rvert^2)'\,dx=\lim_{k\to\infty}-\int_{y_k}^{x_k}x(\lvert f(x)\rvert^2)'\,dx\end{align}
Therefore, if $x(\lvert f(x)\rvert^2)'$ is in $L^1$, which is a prerequisite to write $\int_{\Bbb R}$, then we have the identity $$\int_{\Bbb R}\lvert f\rvert^2\,dx=\lim_{k\to\infty}-\int_{y_k}^{x_k}x(\lvert f(x)\rvert^2)'\,dx=-\int_{\Bbb R} x(\lvert f(x)\rvert^2)'\,dx$$
Notice also that, in principle, under the weaker hypothesis that $\lim_{t\to\infty}\int_0^t x(\lvert f(x)\rvert^2)'\,dx$ and $\lim_{t\to-\infty}\int_t^0 x(\lvert f(x)\rvert^2)'\,dx$ exist, the identity $$\int_{\Bbb R}\lvert f\rvert^2\,dx=-\int_{-\infty}^\infty x(\lvert f(x)\rvert^2)'\,dx$$ holds as well.
