I am looking for a non constant solution to the following equation $$ \Delta f-\nabla f\cdot\nabla g=0\qquad\text{on }\mathbb{R}^2, $$ where $g=g(r)$ is a positive, non constant function and $r=\sqrt{x_1^2+x_2^2}$.
At first I thought to proceed in the following way: I looked for a solution of the first order equation $$ \mathrm{div}X-X\cdot\nabla g=0 $$ for a general vector field on $\mathbb{R}^2$. In analogy to the one-dimensional case I found the following solution $$ X=(X_1,X_2)=\left(c_1e^{g(r)},c_2e^{g(r)}\right) $$ On the other hand, this solution is not a gradient, indeed $$ \partial_2X_1\ne\partial_1X_2 $$ for any choice of the constants $c_1,c_2$, so this procedure doesn't help me to solve the first equation. Is there any other way to look for an explicit solution? I thought that maybe the solution I found to $\mathrm{div}X=X\cdot\nabla g$ is the simplest one but it's not unique.
Any help is very appreciated.
Let $g = -\log h$ which makes $0 < h < 1$. Then by chain rule we have that
$$\Delta f - \nabla f \cdot \nabla(-\log h) = \Delta f + \frac{1}{h}\nabla f \cdot \nabla h = 0$$
$$\implies \nabla \cdot ( h \nabla f) = 0$$
from here there doesn't seem to be any general characterization of the potentials of divergenceless vector fields in two dimensions. The radial condition might be of some use if a practical characterization can be found.
A problem I encountered while trying to tackle the equation head on with the Laplacian in polar coordinates is that the angular dependence ends up being a linear combination of sines and cosines. This may explain why your first attempt failed, because sines and cosines would have had complex values for a first order differential equation.