What functions satisfy $\sum_{i=1}^{n} x_i \frac{\partial f}{\partial x_i} = 0?$ Consider the equation, $\sum_{i=1}^{n} x_i \frac{\partial f}{\partial x_i} = 0$ for $n\geq 1$. By trial and error, I see that $f(x_1,\cdots, x_n)=\sum_{i=1}^{n-1}\frac{x_i}{x_{i+1}}$ works because,
$$\frac{\partial f}{\partial x_i}=-\frac{x_{i-1}}{x_i^2}+\frac{1}{x_{i+1}}, \text{ where }x_0=0,x_{n+1}=+\infty.$$
Then $\sum_{i=1}^{n} x_i \frac{\partial f}{\partial x_i}= \sum_{i=1}^{n}-\frac{x_{i-1}}{x_i}+\frac{x_i}{x_{i+1}}=0.$ But is there a general form of solutions perhaps in higher dimensions say $n\geq 3.$ I guess that when $n=2$, we have $f(x_1, x_2) = f\left(\frac{x_1}{x_2}\right),$ but not sure how to express solutions in higher dimensions. Thus any suggestions/remarks will be much appreciated.
Edit: In general, I want to find functions $f$ such that $x\cdot \nabla f=0$ and $v\cdot \nabla f =0$ where $x=(x_1,\cdots, x_n)$ and $v = (v_1,\cdots, v_n)$ is some constant vector in $\mathbb{R}^n.$
 A: For the PDE $\sum_{i=1}^{n} x_i \frac{\partial f}{\partial x_i} = 0$ we get solution $$f(x_1,\dots,x_n) = F\left(\frac{x_2}{x_1},\frac{x_3}{x_1},\dots,\frac{x_n}{x_1}\right)$$where $F$ is any function of $n-1$ variables.
A: The condition $x \cdot \nabla f(x) = 0$ means that the directional derivative of $f$, at the point $x$ and in the direction of the vector from the origin to $x$, is zero. So $f$ must be constant in the radial direction, and the general solution to the PDE (away from the origin) is thus obtained by taking any nice enough function on the unit sphere and extending it to the whole space (minus the origin) by letting it be constant along rays from the origin.
And the other condition, $v \cdot \nabla f(x) =0$, forces $f$ to be constant along lines parallel to the vector $v$. Since the first condition is rotationally invariant, you are free to rotate your coordinate system to make $v$ point in the $x_n$-direction, and then the condition simply says that $f$ must be independent of $x_n$. So in order to satisfy both conditions, you take a solution to $x \cdot \nabla f(x) = 0$ in $\mathbf{R}^{n-1}$ and extend it to $\mathbf{R}^{n}$ by just adding an extra variable that $f$ doesn't depend upon.
For example, with $n=3$ and $v=(0,0,1)$, the general solution (away from the $z$ axis) in cylinder coordinates $(r,\varphi,z)$ will be $f(r,\varphi,z)=g(\varphi)$ for any nice enough function $g$.
