An integral question. If $u \in C_0^\infty (0,\infty)$, $v(x) := u(x) e^{-x/2}$, then I want to prove the equality $$  \int_0^\infty   ( |u(x) |^2 + x | u'(x) |^2 ) e^{-x} dx = \int_0^\infty \left( \frac{x+2}{4} | v(x) |^2 + x | v'(x) |^2 \right) dx$$ 
holds. Here $C_0^\infty$ means that $C^\infty$ functions with a compact support.
And If I change the condition of $u$ as $\int_0^\infty   ( |u(x) |^2 + x | u'(x) |^2 ) e^{-x} dx < \infty $ then does this still hold?
 A: Since $u(x)=v(x)e^{x/2}$, one has
$$
u'(x)=(v'(x)+\frac{1}{2}v(x))e^{x/2}.
$$
Therefore
\begin{eqnarray}
\int_0^\infty\left(|u(x)|^2+x|u'(x)|^2\right)e^{-x} dx
&=&
\int_0^\infty\left(|v(x)e^{x/2}|^2+x|(v'(x)+\frac{1}{2}v(x))e^{x/2}|^2\right)e^{-x} dx\cr
&=&
\int_0^\infty\left(|v(x)|^2+x|v'(x)+\frac{1}{2}v(x)|^2\right)dx\cr
&=&
\int_0^\infty\left(\frac{x+2}{4}|v(x)|^2++x|v'(x)|^2\right)dx+\int_0^\infty \frac{1}{2}|v(x)|^2dx\cr
&+&\int_0^\infty xv(x)v'(x)dx.
\end{eqnarray}
If $u \in C_0^\infty(\mathbb{R})$, then there is some $R>0$ such that $u(x)=0$ for $x \ge R$, and
$$
\int_0^\infty xv(x)v'(x)dx=\int_0^R xv(x)v'(x)dx=\frac{1}{2}xv^2(x)\big|_0^R-\frac{1}{2}\int_0^Rv^2(x)dx=-\frac{1}{2}\int_0^\infty v^2(x)dx.
$$
Thus
$$
\int_0^\infty\left(|u(x)|^2+x|u'(x)|^2\right)e^{-x} dx
=\int_0^\infty\left(\frac{x+2}{4}|v(x)|^2++x|v'(x)|^2\right)dx.
$$
Let's now replace the condition $u \in C_0^\infty(\mathbb{R})$ by
$$
\int_0^\infty\left(|u(x)|^2+x|u'(x)|^2\right)e^{-x} dx<\infty.
$$
Then $u \in L^2(\mathbb{R}, e^{-x}dx)$.
For every $R>0$ we have
$$
\int_0^R\frac{1}{2}|v(x)|^2dx+\int_0^R xv(x)v'(x)dx=\frac{1}{2}Rv^2(R)=\frac{1}{2}Re^{-R}u^2(R).
$$
Suppose 
$$
\lim_{x \to \infty}xe^{-x}u^2(x)=a>0.
$$
Then there is an $r=r(a)>0$ such that
$$
|xe^{-x}u^2(x)-a| \le \frac{a}{2} \quad \forall x \ge r.
$$
It follows that
$$
e^{-x}u^2(x)=\frac{xe^{-x}u^2(x)-a +a}{x}=\frac{xe^{-x}u^2(x)-a}{x}+\frac{a}{x} \ge -\frac{a}{2x}+\frac{a}{x}=\frac{a}{2x} \quad \forall x \ge r.
$$
Thus
$$
\int_0^\infty e^{-x}u^2(x)dx \ge \frac{a}{2}\int_r^\infty x^{-1}dx=\infty,
$$
contradicting the fact that $u \in L^2(\mathbb{R},e^{-x}dx)$. Hence
$$
\lim_{x \to \infty} xe^{-x}u^2(x)=0,
$$
and the identity holds.
