# 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?

• $f(z) = z e^z = \sum_{m=0}^\infty c_m z^m$ $\implies$ (locally around $u_0 = f(z_0)$, if $f'(z_0) \ne 0$) $f^{-1}(u) = \sum_{k=0}^\infty a_k u^k$ with $z= f^{-1}(f(z)) =\sum_{k=0}^\infty a_k f(z)^k = \sum_{k=0}^\infty a_k (\sum_{m=0}^\infty c_m z^m)^k$ which, after expanding, gives a recurrence relation on the $a_k$'s in term of the binomial coefficients and the $c_m$'s. and if there are other ways, they are equivalent to thisone – reuns Mar 16 '16 at 22:51

## 3 Answers

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|=\epsilon} \frac{1}{w^{n+1}} e^{-w(n+1)} e^w (w+w^2) \; dw \\ = \frac{1}{2\pi i} \int_{|w|=\epsilon} \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 0} \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.

• The upper limit of sigma is infinity right? – Rithik Kapoor Mar 28 at 13:14

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)

It can be easily derived by applying the Lagrange inversion formula to $ze^z$ as it satisfies all criterias of the Lagrange inversion theorem, i.e. $f(0)=0$ and $f'(0)$ is non zero.