Real branches of Lambert W (source code)

= Real branches of Lambert W
{title2=$W_0,\ W_{-1}$}

On $-e^{-1}<z<0$, the <Lambert W function> has two real branches: $-1<W_0(z)<0$ and $W_{-1}(z)<-1$. The <derivative> of $we^w$ is $e^w(1+w)$, so this function decreases on $(-\infty,-1)$ and increases on $(-1,\infty)$, proving the two-branch structure. As $u\to\infty$, <series reversion> gives
$$
W_0(-e^{-u})=-e^{-u}-e^{-2u}+O(e^{-3u}),\qquad W_{-1}(-e^{-u})=-u-\log u+O(\log u/u).
$$
Consequently the two positive roots of $xe^{1/x}=e^u$ are $-1/W_0(-e^{-u})$ and $-1/W_{-1}(-e^{-u})$.