Solutions to differential equation $\nabla f(x)=f(x)x$ Let us consider the differential equation  given by $\nabla f(x)=f(x)x$, where $f:\mathbb{R}^n\to \mathbb{R}$. I have found that $f(x)=K\exp(|x|^2/2)$ is a solution, but are all solution of this form?

We can use the method of integrating factor to prove that this is the only solution. Moving everything to one side, notice that
$$\exp\left(-\frac{x^2}{2}\right)(\nabla f - x f) = 0 \implies \nabla \left(\exp\left(-\frac{x^2}{2}\right) f\right) = 0$$
which means 
$$f(x) = K\exp\left(\frac{x^2}{2}\right)$$
