Solutions for second(first) order differential equation in scalar(vector) field on $\Bbb R^3$

In the context of a physics problem on a gauge for a vector potential of a magnetic field I arrive at the following differential equation:

$$\nabla\cdot\nabla f(\vec{r})={\color{red}-}\left( \frac{1}{2}\vec{B}\times\vec{r} {-} \nabla f(\vec{r}) \right)\cdot\frac{\nabla \rho(\vec{r})}{\rho(\vec{r})},$$

with $$\vec{r}\in\Bbb R^3$$ is the general variable the functions depend on, $$\rho$$ is a given non-negative function $$\Bbb R^3\to\Bbb R^+$$, $$\vec{B}$$ a constant non-zero vector and $$f$$ an unknown scalar function ($$f: \Bbb R^3\to\Bbb R$$), the $$\cdot$$ denotes the scalar product of two vectors.

1. Do solutions for $$f$$ exist?
2. Is it possible to say something else than the above equation on the form of the solutions $$f$$? (Especially: is there an analytical solution?)

EDIT: Rechecking your re-derivation of my starting equation I found I have confused a sign, I have marked the corrected sign in $$\color{red}r\color{red}e\color{red}d$$ above (it has been $$+$$ in the original version, the answer is referring to). The overall equation and problem is not affected at all, since it was implied that we can change the constant $$\vec{B}$$ vector (mag. field) freely and the sign of $$f$$ as well (scalar gauge term of the vector potential).

The expression I have started of with is actually $$\nabla\cdot \left[ \left( \frac{1}{2}(\vec{B}\times\vec{r}) + \nabla f(\vec{r}) \right) \rho(\vec{r})\right] = 0 .$$ That is I search for a gauge contribution $$\nabla f$$ to the vector potential for which the vector field inside the brackets is divergence-less.

Due to the complexity of the topic of the question, it is not possible to expound here all the associated analytic developments, therefore I try to answer by giving precise references and surveying the results presented there.

1. Do solutions for $$f$$ exist?

Yes: to see this, note that, after formally manipulating your equation (perhaps going backward in the steps of your deduction), we get $$\begin{split} \nabla\cdot\nabla f(\vec{r})&=\left( \frac{1}{2}\vec{B}\times\vec{r} - \nabla f(\vec{r}) \right)\cdot\frac{\nabla \rho(\vec{r})}{\rho(\vec{r})}\\ \rho(\vec{r})\nabla\cdot\nabla f(\vec{r})&=\left( \frac{1}{2}\vec{B}\times\vec{r} - \nabla f(\vec{r}) \right)\cdot\nabla \rho(\vec{r})\\ \rho(\vec{r})\nabla\cdot\nabla f(\vec{r})&=\left( \frac{1}{2}\vec{B}\times\vec{r} - \nabla f(\vec{r}) \right)\cdot\nabla \rho(\vec{r})\\ \rho(\vec{r})\nabla\cdot\nabla f(\vec{r})+\nabla \rho(\vec{r})\cdot\nabla f(\vec{r})&=\frac{1}{2}\vec{B}\times\vec{r}\cdot\nabla \rho(\vec{r})\\ \end{split}$$ i.e. $$\nabla\cdot\big(\rho(\vec{r})\nabla f(\vec{r})\big)=\frac{1}{2}\vec{B}\times\vec{r}\cdot\nabla \rho(\vec{r}).\label{1}\tag{1}$$ Equation \eqref{1} is a standard linear elliptic equations in divergence form, and as such it admits a fundamental solution (and also a Green function) i.e. a solution of the equation $$\nabla\cdot\big(\rho(\vec{r})\nabla \mathscr{E}(\vec{r},\vec{s})\big)=\delta(\vec{r}-\vec{s})\label{2}\tag{2}$$ where $$\delta$$ is the usual Dirac distribution, under fairly general conditions. In particular $$\rho(\vec{r})$$ is required only to be a bounded and measurable function: moreover, the problem has a solution even if, instead of a scalar function $$\rho(\vec{r})$$, we have a second-order tensor function $$\vec{r}\mapsto\overline{\overline{\boldsymbol{\rho}}}(\vec{r})\in\Bbb R^{3\times 3}\quad\vec{r}\in\Bbb R^3 \label{3}\tag{3}$$ with bounded measurable components. This result is due to Walter Littman, Guido Stampacchia and Hans Weinberger: the paper [2] (where the original result is to be found) is not an easy read and even the used notation is not a modern one, while the set of lecture notes [3] is a better readable source (with also an updated notation) but is written in French. A more modern reference is [1], where the authors prove also that the tensor of the coefficients \eqref{3} can be asymmetric.

1. Is it possible to say something else than the above equation on the form of the solutions $$f$$? (Especially: is there an analytical solution?)

Yes (with some cautions): for the general case, several properties of the solution to equation \eqref{2}, and these properties "interact" with the ones of the given function $$\frac{1}{2}\vec{B}\times\vec{r}\cdot\nabla\rho(\vec{r})$$ (have again a look at the items in the bibliography for the details and also at this answer). For example it is known that the quotient between $$\mathscr{E}(\vec{r},\vec{s})$$ and the fundamental solution of Laplace equation is bounded by two positive constants $$K$$ and $$K^{-1}$$. And also you can use $$\mathscr{E}(\vec{r},\vec{s})$$ to construct a fairly explicit general solution of \eqref{1} as a convolution integral: $$f(\vec{r})=\int\limits_{\Bbb R^3}\mathscr{E}(\vec{r},\vec{s})\big(\vec{B}\times\vec{s}\cdot\nabla\rho(\vec{s})\big)\mathrm{d}\vec{s}$$ However, it is not always possible to construct explicitly the fundamental solution $$\mathscr{E}(\vec{r},\vec{s})$$ (in this respect see also this answer thus, apart from the case $$\rho(\vec{r})\equiv\mathrm{const}.$$ where \eqref{1} reduce to the Laplace equation $$\nabla\cdot\nabla f(\vec{r})=0,$$ I am not aware of the existence of any exact (meant as expressed by means of more or less elementary functions) solutions to \eqref{1}.

Bibliography

[1] Michael Grüter and Kjell-Ove Widman (1982), "The Green function for uniformly elliptic equations", Manuscripta Mathematica 37, pp. 303-342 Zbl 0485.35031.

[2] Walter Littman, Hans Weinberger and Guido Stampacchia (1962), "Regular points for elliptic equations with discontinuous coefficients", Annali della Scuola Normale Superiore di Pisa, Classe di Scienze, serie III, Vol. 17, n° 1-2, pp. 43-77, MR161019, Zbl0116.30302.

[3] Guido Stampacchia (1966), "Équations elliptiques du second ordre à coefficients discontinus" (notes du cours donné à la 4me session du Séminaire de mathématiques supérieures de l'Université de Montréal, tenue l'été 1965), (in French), Séminaire de mathématiques supérieures 16, Montréal: Les Presses de l'Université de Montréal, pp. 326, ISBN 0-8405-0052-1, MR0251373, Zbl 0151.15501.

• @Rudi_Birnbaum, you're welcome. Regarding the uniqueness problem, you cannot expect it for the fundamental solution, as it is unique apart from additive solutions to the homogeneous equation, i.e. solutions to $$\nabla\cdot\rho(\vec{r})\nabla f(\vec{r})=0.$$ However, a technique which could ensure uniqueness is to require on $f$ a behavior at infinity such that the homogeneous equation has no solution. This happens for example when $\rho\equiv\mathrm{const.}$ by requiring $f\to 0$ when $\vec{r}\to \infty$ – Daniele Tampieri Apr 21 at 9:58
• @Rudi_Birnbaum ...(continued from above) and then invoking the Phragmén–Lindelöf principle, and also this is what happens when you use the Bohr-Sommerfeld radiation condition on the Helmholtz equation. In turn, this is also the same thing that you do on a bounded domain, when you construct a Green's function: you state appropriate boundary conditions on a sufficiently regular boundary and then you get uniqueness (and existence) of the solution of the equation on that domain. However, the possibility of doing so is strongly related to the structure of the (resistivity?) $\rho$. – Daniele Tampieri Apr 21 at 10:18
• Well in "reality" the electron density $\rho$ is very quickly going to zero (roughly exponentially). Is very well behaved apart from that. It only has some "cusps" at positions of atomic nuclei, otherwise its everywhere positive continuous and differentiable. (Its the molecular electron density). – Rudi_Birnbaum Apr 22 at 16:00
• @Daniele_Tempieri: Can't one use here the famous $$\nabla\cdot \frac{\vec{r}}{4 \pi r^3} = \delta({\vec{r}})$$ to tackle (2)? – Rudi_Birnbaum Apr 30 at 18:31
• @Daniele_Tampieri: the solution I found by some guessing and some further reasoning is that $f(\vec{r})$ can be any function of $\rho$ (which by itself is a function of $\vec{r}$). Using such $f$ one can see immediately that the expression in brackets gets divergence free (all assuming suitably well behaved functions). Moreover I think that's all of the possible functions. A special solution would be $f=const.$ which formally is of course also a function of $\rho(\vec{r})$. – Rudi_Birnbaum Jul 10 at 9:35