Show $\psi=(x\phi)'$ for a test function $\phi$. I need to prove the following theorem:
Let $\psi$ be a test function. Show that $\psi=(x\phi)'$ for some test function $\phi$ if and only if
$\int_{-\infty}^{\infty}\psi(x)dx = 0$ and $\int_{0}^{\infty}\psi(x)dx = 0$
I'm given the hint that if $h(0)=0$, then $h(x)=\int_0^1\frac{d}{dt}h(tx)dt$
So I saw this and tried defining $h(x)=-\int_{x}^{\infty}\psi(x)dx$ so that $h(0)=0$ and $h'=\psi$.
So how can I show that $h=x\phi$ for some $\phi$?
I tried using then that $h(x)=\int_0^1\frac{d}{dt}(-\int_{tx}^{\infty}\psi(y)dy)dt$, but it's led me nowhere.
 A: First direction: Suppose $\psi = (x\phi)'$ then
$$\int_{-\infty}^{\infty}(x\phi)'\, dx  = \lim_{x \to \infty} x (\phi(x) + \phi(-x)).$$ Since $\phi$ is a test function (exactly zero outside the support), this is $0$. 
Second implication: Suppose $\int_{-\infty}^{\infty}\psi(x)\, dx = \int_{0}^{\infty}\psi(x)\, dx = 0 \,\,(*)$. Then I can write down a differential equation for some $\phi$:
$$ x \phi'(x) + \phi(x) = \psi(x)$$
$$ \phi(0) = \psi(0). $$
The formal solution is $\phi(x) = \frac{1}{x}\int_{0}^{x}\psi(x')\, dx'$. Next is the proof that $\phi \in C^{\infty}$. For $x \neq 0$, 
$$\phi^{(n)}(x) = \sum_{k = 0}^n {{n}\choose{k}}\frac{(-1)^n n!}{x^{n+1}} \psi^{(k-1)}(x)$$ which is well defined $\forall n$. Around $x = 0$ use Taylor expansion and uniform convergence to prove that $\lim_{x\to 0} \phi^{(n)}(x) < \infty.$
Now let $\inf \text{supp}(\psi) := a,\,  \sup \text{supp}(\psi) :=b$. Then by using the definition of the support: $$\phi(b + x) = \phi(b), \, \forall x \geq 0.$$ Using the limit $x \to \infty$ and $(*)$ it's evident that $\phi(x) = 0, \, \forall x > b.$ Using $a$ in the same way it's clear $\phi(x) = 0,\, x < a.$
