How to derive the Lambert W function series expansion?
How do you use the Lagrange inversion theorem to derive the Taylor Series expansion of W(x)? How else can you derive a series expansion?
Solution 1:
There is a variant of Lagrange inversion which I like to call poor man's Lagrange inversion which consists in using the Cauchy Residue Theorem.
In the present case we are looking for the inverse to $ze^z$ so that $$W(x) e^{W(x)} = x.$$
From the Cauchy Residue Theorem we get $$[x^n] W(x) = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^{n+1}} W(z) \; dz.$$
Now put $W(z) = w$ so that $w e^w = z$ and $e^w (1+w) \; dw = dz$ to obtain (we use the branch that takes $w=0$ to $z=0$, there is another that takes $w=-\infty$ to $z=0$)
$$\frac{1}{2\pi i} \int_{|w|=\gamma} \frac{1}{w^{n+1}} e^{-w(n+1)} e^w (w+w^2) \; dw \\ = \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{1}{w^{n+1}} e^{-wn} (w+w^2) \; dw.$$
Extracting coefficients now yields
$$\frac{(-1)^{n-1} n^{n-1}}{(n-1)!} + \frac{(-1)^{n-2} n^{n-2}}{(n-2)!} \\ = \frac{(-1)^{n-1}}{n!} n^{n-1} (n - (n-1)) = \frac{(-1)^{n-1}}{n!} n^{n-1}.$$
We conclude that $$W(x) = \sum_{n\ge 1} \frac{(-1)^{n-1}}{n!} n^{n-1} x^n.$$
Here is an example I at MSE and another example II at MSE of Lagrange inversion.
Addendum, Sep. 17 2020. For a more compact version use Lagrange Inversion as presented in Analytic Combinatorics by Flajolet and Sedgewick. We first choose the branch that has $W(0) = 0.$ We then have $W'(x) e^{W(x)} + W(x) e^{W(x)} W'(x) = 1$ so that $W'(1) = 1$. This means we may write for $n\ge 1$ by the Cauchy Coefficient Formula
$$[x^n] W(x) = \frac{1}{n} [x^{n-1}] W(x) = \frac{1}{n} \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^n} W'(z) \; dz.$$
Putting $W(z) = w$ we also have $W(z) = z + \cdots$ so that the image of the circle in $z$ is a contour in $w$ that makes one turn by the origin and may in turn be deformed to another small circle. We then have
$$[x^n] W(x) = \frac{1}{n} \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{1}{w^n} \exp(-nw) \; dw.$$
This is by inspection
$$\frac{1}{n} [w^{n-1}] \exp(-nw) = \frac{1}{n} \frac{(-n)^{n-1}}{(n-1)!} = \frac{(-1)^{n-1}}{n!} n^{n-1}$$
as before.
Solution 2:
While the common way to derive it is by using the Lagrange Inverse Theorem, there technically isn't anything stopping us from making a Taylor Series for it as you would with any other function. As always, we're going to need a list of derivatives. The first one can be found pretty easily via implicit differentiation as follows:
$$y = W(x)$$ $$ye^y = x$$ $$\frac{d}{dx}\left(ye^y=x\right)$$ $$\left(y+1\right)e^y\cdot\frac{dy}{dx}=1$$ $$\therefore \frac{d}{dx}W\left(x\right)=\frac{e^{-W\left(x\right)}}{\left(W\left(x\right)+1\right)}$$ $$\frac{d}{dx}W\left(x\right)=\frac{W\left(x\right)}{x\left(W\left(x\right)+1\right)}$$
Also, to anyone unfamiliar with the last step, it is one of the main identities of the Lambert W function.
Now that we have the first derivative, we can simply differentiate as many times as we want to get all subsequent derivatives. The important thing to note, however, is that all subsequent derivatives will only require the W function to be evaluated at x. Therefore, if we know the value of W(x) we can theoretically calculate the value of any nth derivative of W(x) at that x. We can use this to our advantage by considering a value of W which is easy to calculate, such as W(e). This can be calculated as follows:
$$y=W\left(e\right)$$ $$ye^y=e=1e^1$$ $$\therefore y=1 \Rightarrow W(e)=1 $$
We now have everything we need to calculate a Taylor Series centered at x=e as usual.
$$\sum_{n=0}^{\infty}\frac{W^{\left(n\right)}\left(e\right)}{n!}\left(x-e\right)^n$$
$$=1+\frac{1\left(x-e\right)}{2\cdot e\cdot1!}-\frac{3\left(x-e\right)^2}{2^3e^2\cdot2!}+\frac{19\left(x-e\right)^3}{2^5e^3\cdot3!}-\frac{185\left(x-e\right)^4}{2^7e^4\cdot4!}+\frac{2437\left(x-e\right)^5}{2^9e^5\cdot5!}...$$
I agree that this isn't as useful as the Lagrange Inverse method (mostly due to the lack of an explicit definition for the coefficients), however I felt it was worth noting as the question did ask if there were any other methods. And, as shown by the plot of the 5th degree polynomial, this does indeed work.
5th Degree Polynomial Approximation of W(x)
Solution 3:
Another approach is to start with
$$
x=we^w\tag1
$$
and differentiate to get
$$
\begin{align}
1&=(w+1)e^ww'\tag2\\
w&=(w+1)xw'\tag3\\
w-xw'&=xww'\tag4
\end{align}
$$
Explanation:
$(2)$: derivative of $(1)$
$(3)$: multiply by $w$
$(4)$: subtract $xw'$
Next take the coefficient of $x^n$:
$$
\begin{align}
(1-n)a_n&=\sum_{k=1}^{n-1}ka_ka_{n-k}\tag5\\
&=\frac n2\sum_{k=1}^{n-1}a_ka_{n-k}\tag6\\
a_n&=-\frac n{2(n-1)}\sum_{k=1}^{n-1}a_ka_{n-k}\tag7
\end{align}
$$
Explanation:
$(5)$: coefficient of $x^n$ from $(4)$
$(6)$: substitute $k\to n-k$ in $(5)$ and average with $(5)$
$(7)$: divide by $1-n$
$(7)$ provides a recursion for $a_n$, so we compute some values:
$$
\begin{array}{c|cc}
n&1&2&3&4&5&6&7&8&9&10&11\\\hline
a_n&1&\!-1&\!\frac32&\!-\frac83&\!\frac{125}{24}&\!-\frac{54}5&\!\frac{16807}{720}&\!-\frac{16384}{315}&\!\frac{531441}{4480}&\!-\frac{156250}{567}&\!\frac{2357947691}{3628800}\\
\end{array}\tag8
$$
Noting that $a_n$, for $n$ prime, is $(-1)^{n-1}\frac{n^{n-2}}{(n-1)!}=\frac{(-n)^{n-1}}{n!}$, it is easy to verify that the same is true for the other $n$ in the table. To prove that this is true for all $n$, we can use $(7)$ and induction: suppose that $a_k=\frac{(-k)^{k-1}}{k!}$ for $k\lt n$, then
$$
\begin{align}
a_n
&=-\frac n{2(n-1)}\sum_{k=1}^{n-1}\frac{(-k)^{k-1}}{k!}\frac{(k-n)^{n-k-1}}{(n-k)!}\tag9\\
&=\frac n{2(n-1)}\frac{(-1)^{n-1}}{n!}\sum_{k=1}^{n-1}\binom{n}{k}k^{k-1}(n-k)^{n-k-1}\tag{10}\\
&=\frac1{2(n-1)}\frac{(-1)^{n-1}}{n!}\sum_{k=1}^{n-1}\binom{n}{k}\left(k^k(n-k)^{n-k-1}+k^{k-1}(n-k)^{n-k}\right)\tag{11}\\
&=\frac1{(n-1)}\frac{(-1)^{n-1}}{n!}\sum_{k=1}^{n-1}\binom{n}{k}k^{k-1}(n-k)^{n-k}\tag{12}\\
&=\frac1{(n-1)}\frac{(-1)^{n-1}}{n!}(n-1)n^{n-1}\tag{13}\\[3pt]
&=\frac{(-n)^{n-1}}{n!}\tag{14}
\end{align}
$$
Explanation:
$\phantom{1}(9)$: $(7)$ and the inductive hypothesis
$(10)$: move factors around
$(11)$: distribute $n=k+(n-k)$
$(12)$: substitute $k\mapsto n-k$ in the left term of the summand
$(13)$: apply Abel's identity, equation $(6)$ from this answer, using $b=n,t=1$:
$\phantom{(13)\text{:}}$ $\sum\limits_{k=1}^{n-1}\binom{n}{k}(a+k)^{k-1}(n-k)^{n-k}=\frac{(a+n)^n-n^n}a-(a+n)^{n-1}$
$\phantom{(13)\text{:}}$ $\stackrel{a\to0}\longrightarrow\quad\sum\limits_{k=1}^{n-1}\binom{n}{k}k^{k-1}(n-k)^{n-k}=(n-1)n^{n-1}$
$(14)$: simplify
Thus, we have shown that for all $n\ge1$, $$ a_n=\frac{(-n)^{n-1}}{n!}\tag{15} $$ Therefore, $$ \operatorname{W}(x)=\sum_{n=1}^\infty\frac{(-n)^{n-1}}{n!}x^n\tag{16} $$