$\nabla \cdot f + w \cdot f = 0$ Let $w(x,y,z)$ be a fixed vector field on $\mathbb{R}^3$. What are the solutions of the equation
$$
\nabla \cdot f + w \cdot f = 0 \, ?
$$
Note that if  $w = \nabla \phi $, then the above equation is equivalent to
$$
\nabla \cdot (e^\phi f) = 0,
$$
for which the solutions are of the form $f = e^{-\phi} \nabla \times g$ for some arbitrary $g$.

You can try to proceed along the following lines:
\begin{equation*}
(\partial _{\mathbf{x}}+\mathbf{w})\cdot \mathbf{f}=0
\end{equation*}
Special case $\mathbf{w}$ is constant. Then
\begin{equation*}
\exp [-\mathbf{w\cdot x}]\partial _{\mathbf{x}}\exp [+\mathbf{w\cdot x}
]=\partial _{\mathbf{x}}+\mathbf{w}
\end{equation*}
so
\begin{eqnarray*}
\exp [-\mathbf{w\cdot x}]\partial _{\mathbf{x}}\exp [+\mathbf{w\cdot x}%
]\cdot \mathbf{f} &=&0 \\
\partial _{\mathbf{x}}\cdot \{\exp [+\mathbf{w\cdot x}]\mathbf{f}\} &=&0 \\
\exp [+\mathbf{w\cdot x}]\mathbf{f} &\mathbf{=a}&+\partial _{\mathbf{x}%
}\times \mathbf{b(x)} \\
\mathbf{f(x)} &=&\exp [-\mathbf{w\cdot x}]\{\mathbf{a}+\partial _{\mathbf{x}%
}\times \mathbf{b(x)}\}
\end{eqnarray*}
In general you have to find $\mathbf{U}(\mathbf{x})$ ($3\times 3$ matrix)
such that
\begin{equation*}
\mathbf{U}^{-1}(\mathbf{x})\cdot \partial _{\mathbf{x}}\cdot \mathbf{U}(%
\mathbf{x})=\partial _{\mathbf{x}}+\mathbf{w(x})
\end{equation*}
Let
\begin{eqnarray*}
\mathbf{U}(\mathbf{x}) &=&\exp [\mathbf{A(x)}] \\
\partial _{\mathbf{x}}\cdot \mathbf{U}(\mathbf{x}) &=&\mathbf{U}(\mathbf{x}%
)[\partial _{\mathbf{x}}+\{\partial _{\mathbf{x}}\cdot \mathbf{A(x)\}]} \\
\partial _{\mathbf{x}}\cdot \mathbf{A(x)} &=&\mathbf{w(x})
\end{eqnarray*}
Then
\begin{eqnarray*}
(\partial _{\mathbf{x}}+\mathbf{w(x)})\cdot \mathbf{f} &=&\mathbf{U}^{-1}(%
\mathbf{x})\cdot \partial _{\mathbf{x}}\cdot \{\mathbf{U}(\mathbf{x})\cdot
\mathbf{f}\}=0 \\
\partial _{\mathbf{x}}\cdot \{\mathbf{U}(\mathbf{x})\cdot \mathbf{f}\} &=&0
\\
\mathbf{U}(\mathbf{x})\cdot \mathbf{f(x)} &=&\{\mathbf{a}+\partial _{\mathbf{
x}}\times \mathbf{b(x)}\} \\
\mathbf{f(x)} &=&\mathbf{U}^{-1}(\mathbf{x})\cdot \{\mathbf{a}+\partial _{
\mathbf{x}}\times \mathbf{b(x)}\}
\end{eqnarray*}
