# Analytical expressions for multiply-sloped solutions of a differential equation

The differential equation

$\frac{1}{u(r)}u^\prime(r)(u^2(r)-1)=\frac{2}{r}-\frac{2}{r^2}$

has four classes of solutions, as illustrated in this figure:

1. $u'=0$, $u''<0$ at $r=1$
2. $u=1$, $u'=+1$ at $r=1$
3. $u=1$, $u'=-1$ at $r=1$
4. $u'=0$, $u''>0$ at $r=1$

The slope for the case $u(1)=1$ can be gotten from $\lim_{h \to 0}u'(1+h)$:

$$u'(1+h)=\frac{u(1+h)}{u(1+h)^2-1}\left(\frac{2}{1+h}-\frac{2}{(1+h)^2}\right)$$

and using the binomial approximation $(1+h)^\alpha \approx 1+\alpha h$ for small $h$, and the expansion $u(1+h)=u(1)+h u'(1) + O(h^2)$:

$$u'(1+h)=\frac{1+h u'(1)}{u'(1)}$$

Taking the limit $h \to 0$ gives

$u'(1) = \pm 1$

As shown in the figure, however, I am able to numerically solve the equation for cases 1 (blue and magenta curves) and 4 (green and yellow curves). The numerical solver fails for the case u(1)=1, where the derivative is, naively, $0/0$.

Is there an analytical solution to this differential equation that allows me to plot solutions of class 2 and 3? Or can the equation be recast to permit a numerical solution in this case?

-

According to Maple 15, the general solution in implicit form is

$$\ln(r)+\frac{1}{r}-\frac{u(r)^2}{4} +\frac{\ln(u(r))}{2}+C = 0$$

Your curves 2 and 3 correspond to $C = -3/4$. Here are some solutions as plotted using Maple's implicitplot command.

The equation can be solved explicitly using the Lambert W function:

$$u \left( r \right) ={{\rm e}^{-1/2\, \left( 4\,\ln \left( r \right) r +4+{\rm LambertW} \left( -{{\rm e}^{-4\,{\frac {1+Cr}{r}}}}{r}^{-4} \right) r+4\,Cr \right) {r}^{-1}}}$$

The Lambert W function has two real branches on $[-1,0]$: the "0" branch gives you the parts of the solution curves between 0 and 1, the "-1" branch gives you the parts above 1.

-