# Differential equation for spherically symmetric function

During my physics research in cosmology I encountered a differential equation of the following type ($$f,g$$ are functions that only depend on the spherical coordinate $$r$$, $$\partial_i$$ means $$\partial/\partial x^i$$ where $$x^i \in \{x,y,z\}$$ etc.):

$$$$\nabla^2 f - [a_1(\nabla^2 f)^2 - a_2 \sum^3_{i,j=1}(\partial_i \partial_j f)(\partial_i \partial_j f)] = -g(r)$$$$

where $$a_1,a_2$$ are arbitrary (non-zero) real numbers (constants).

Useful identities are (since $$f = f(r)$$):

$$$$(\nabla^2 f)^2 = \Big(\frac{d^2 f}{dr^2}\Big)^2 + \frac{4}{r}\Big(\frac{d^2 f}{dr}\Big)\Big(\frac{df}{dr}\Big) + \frac{4}{r^2} \Big(\frac{df}{dr}\Big)^2$$$$

and

$$$$\sum^3_{i=1} \sum_{j = 1}^3 (\partial_i \partial_j f)(\partial_i \partial_j f) = \frac{2}{r^2}\Big(\frac{df}{dr}\Big)^2 + \Big(\frac{d^2 f}{dr^2}\Big)^2$$$$

We would like to get an analytical solution for for $$df/dr$$ if it exists and otherwise a numerical one would be useful.

• Are you sure about the second useful identity? With $f(r)=r=\sqrt{x^2+y^2+z^2}$ I get $$\partial_xf=\frac{x}r\,,\quad \partial_y\partial_xf=-\frac{xy}{r^3}\,.$$ Commented Jan 25 at 14:47
• Excuse me, there is an implicit summation over $i,j$ in my expressions, let me edit it. For me it was obvious since we do in physics this all the time (Einstein summation convention) but indeed this should be mentioned explicitly! Commented Jan 25 at 15:31

We're looking to solve the nonlinear first-order equation $$(a_2 - a_1) (u')^2 + u' - \frac{4 a_1 u' u}{r} + \frac{2 u}{r} + \frac{2 (a_2 - 2 a_1)}{r^2} u^2 = g(r)$$ for $$u(r) := f'(r)$$. For general $$a_1, a_2$$ the equation looks pretty difficult, at least for general $$g$$, but at in least in a few special cases the equation can be solved:
• $$a_2 = 0$$: $$u(r) = \frac{1}{r^2} \left[C + \frac{1}{2 a_1} \int^r s^2 \left(1 \pm \sqrt{1 - 4 a_1 g(s)}\right) \,ds \right]$$
• $$a_2 = a_1 = a$$: $$u(r) = \frac{1}{4 a} r \left[1 \pm \sqrt{r^2 - \frac{8}{a r} \left(\int^r s^2 g(s) \,ds + C\right)}\right].$$
In the case that $$g$$ is constant, say, $$g(r) = \lambda$$, which o.p. mentioned in the comments, substituting $$u(r) = r v(r)$$ and regarding $$r$$ as a function of $$v$$ gives $$\frac{r'}{r} = \frac{\pm 1 - 4 a_1 v - \sqrt{8 a_2 (3 a_1 - a_2) v^2 - 8 a_2 v + 4 (a_2 - a_1) \lambda + 1}}{4 (2 a_1 - a_2) v^2 - 4 v + \lambda},$$ so $$r(v) = C \exp \int^v h(s) \,ds ,$$ where $$h$$ is the expression on the right-hand side of the above differential equation in $$v$$. Moreover, $$\int^v h(s) \,ds$$ can be integrated in terms of elementary functions for any $$a_1, a_2, \lambda$$, but the form of the formula will depend on the discriminants of the two quadratics in $$v$$ that appear. The numerator of the quadratic under the radical is $$32 a_2 (a_1 - a_2) (12 a_1 \lambda - 4 a_2 \lambda - 3)$$, which gives some additional insight into why the cases $$a_2 = 0$$ and $$a_1 = a_2$$ are comparatively manageable.
• Thanks. What about if $g(r)$ is some non-zero constant while having $a_1,a_2$ general? Commented Jan 25 at 23:43
• One can say a little more in that case---I've updated my answer to include that case---but even then an explicit formula for $u(r)$ is probably hopeless. Commented Jan 26 at 1:02