1 Introduction

The Lambert W function is the multi-valued inverse of the holomorphic function \(E :z\mapsto z\exp z\). It is well known that W has very many applications throughout the sciences, and even though there are very few explicit formulae available for any of the branches of W, its usefulness has grown enormously in recent times due to our ability to compute specific values of W. For more details on the Lambert W function and its many applications we refer the reader to, for example [3,4,5].

It is well known that the function E is a bijective conformal map of the U-shaped region \(\varOmega _0\) in Fig. 6 onto the cut plane \(\mathbb {C}\backslash (-\infty ,-1/\mathrm{e}]\), which we denote by \({\mathcal {C}}\). Here, the region \(\varOmega _0\) is bounded by the curve \(x\sin y + y\cos y = 0\), where \(-\pi< y < \pi \), and this curve has (in the obvious sense) the lines \(y = \pi \) and \(y = -\pi \) as asymptotes. This fact leads us to the (standard) definition of the principal branch \(W_0:{\mathcal {C}} \rightarrow \varOmega _0\) of the Lambert W function as the single-valued inverse of the map E of \(\varOmega _0\) onto \({\mathcal {C}}\).

Fig. 1
figure 1

The principal branch \(W_0:{\mathcal {C}} \rightarrow \varOmega _0\) of the Lambert function

If we expand \(W_0\) in a power series about the origin we obtain

$$\begin{aligned} W_0(z) = \sum _{n=1}^\infty \frac{(-n)^{n-1}}{n\,!}z^n, \end{aligned}$$
(1.1)

which, by the ratio test, has radius of convergence \(1/\mathrm{e}\) (and so converges in the shaded disc in Fig. 1). This power series can be analytically continued from the shaded disc to give the conformal map \(W_0\) of \({\mathcal {C}}\) onto \(\varOmega _0\), and the main result in this paper is the following formula for this analytic continuation.

Theorem 1

For each z in \({\mathcal {C}}\) we have

$$\begin{aligned} W_0(z) = \sum _{m=1}^\infty a_m \left( \frac{\sqrt{\mathrm{e}z+1}-1}{\sqrt{\mathrm{e}z+1}+1}\right) ^m, \quad a_m = \sum _{n=1}^m \frac{(-n)^{n-1}}{n\,!}\left( \frac{4}{\mathrm{e}}\right) ^n \left( {\begin{array}{c}m+n-1\\ m-n\end{array}}\right) . \end{aligned}$$
(1.2)

Theorem 1 gives a series representation of the principal branch \(W_0\) which is valid throughout its the entire domain of definition \({\mathcal {C}}\), and it appears that no such representation has been given before. In summary, (1.2) provides an analytic continuation of (1.1) from the shaded disc \(\{|z|< 1/\mathrm{e}\}\) to the entire cut plane \({\mathcal {C}}\).

For the benefit of the reader, we now discuss the properties of E, the action of E on the real axis, and the shape of the domain \(\varOmega _0\) bounded by the curve given by \(x\sin y + y\cos y = 0\); this material, which is not new, is given in the next three sections. We then prove Theorem 1, and follow this with a discussion of a possible extension of it to other branches of the Lambert W function.

2 Properties of the Function E

Let \(\mathbb {C}_\infty \) (\(= \mathbb {C} \cup \{\infty \}\)) be the extended complex plane. As E is holomorphic throughout \(\mathbb {C}\) with an essential singularity at \(\infty \), Picard’s great theorem (see [2, 7]) implies that, for at most two exceptional values of a in \(\mathbb {C}_\infty \), the equation \(E(z) = a\) has infinitely many solutions in \(\mathbb {C}\). As \(E \ne \infty \) in \(\mathbb {C}\), the value \(\infty \) is one of these exceptional values. Next, as \(E(z)=0\) if and only if \(z=0\), the value 0 is another exceptional value; thus the two exceptional values for E do exist and are 0 and \(\infty \). This shows that, for every non-zero complex number a, the equation \(E(z) = a\) has infinitely many solutions in \(\mathbb {C}\). In particular, E maps \(\mathbb {C}\) onto itself, and each non-zero point of \(\mathbb {C}\) is ‘covered’ infinitely often by E. As \(E'(z) \ne 0\) when \(z \ne -1\), for each point \(z_0\) other than \(-1\), the map E provides a conformal bijection of some open neighbourhood N of \(z_0\) onto the open neighbourhood E(N) of \(E(z_0)\), and the inverse of this conformal bijection is a branch of the Lambert W function which maps E(N) onto N. Finally, as \(E'(-1)=0\) and \(E''(-1)\ne 0\), the map E near the point \(-1\) is, up to a change of co-ordinates by a conformal mapping, the map \(z \mapsto z^2\) of the open unit disc \(\{z:|z|<1\}\) onto itself.

We end this section with a brief description of the asymptotic values of E even though we shall not use them here. A number v is an asymptotic value of E if there is a curve \(\Gamma \) in \(\mathbb {C}_\infty \) that starts at some point in \(\mathbb {C}\) and ends at \(\infty \), and which is such that \(E(z) \rightarrow v\) as z moves towards \(\infty \) along \(\Gamma \). As \(E(x) \rightarrow \infty \) as \(x\rightarrow +\infty \), and \(E(x) \rightarrow 0\) as \(x \rightarrow -\infty \), the two exceptional values 0 and \(\infty \) of E mentioned above are also asymptotic values of E. In fact, as we shall now show, these are the only asymptotic values of E. First, the entire function E is of order one (see [10] for the definition of the order of an entire function). Next, it follows from the well-known Denjoy–Carleman–Ahlfors theorem that as E has order one, it has at most two direct singularities; see [6] for a discussion of this result. As 0 and \(\infty \) are direct singularities, these are the only asymptotic values of E.

3 The Two Real Branches of W

The function E maps the real line \(\mathbb {R}\) into itself. The graph of \(E:\mathbb {R} \rightarrow \mathbb {R}\) is shown in Fig. 2, and this shows that E is

  1. (i)

    a strictly decreasing map of \((-\infty ,-1]\) onto \([-1/\mathrm{e},0)\), and

  2. (ii)

    a strictly increasing map of \([-1,+\infty )\) onto \([-1/\mathrm{e},+\infty )\).

The inverse of the map in (i) is denoted by \(W_{-1}\); the inverse of the map in (ii) is \(W_0\).

Fig. 2
figure 2

The graph of the function \(E:\mathbb {R} \rightarrow \mathbb {R}\)

4 The Region \(\varOmega _0\)

If \(z=x+iy\) and \(E(z) = u+iv\), then

$$\begin{aligned} u(x+iy)&= (x\cos y -y\sin y)\exp x;\\ v(x+iy)&= (x\sin y +y\cos y)\exp x. \end{aligned}$$

It follows that E(z) is real if and only if \(x\sin y +y\cos y = 0\). Further, if \(x\sin y +y\cos y = 0\) and \(y=n\pi \), where n is an integer, then \(y=0\). This shows

  1. (i)

    if \(E(x+iy)\) is real then \(y=0\) or, for some integer n, \(n\pi< y < (n+1)\pi \);

  2. (ii)

    if \(x\sin y +y\cos y = 0\) and \(y \ne 0\), then \(E(x+iy) = -y\mathrm{e}^x/\sin y\);

  3. (iii)

    if \(x\sin y +y\cos y = 0\) and \(n\pi< y < (n+1)\pi \) then \(E(x+iy)>0\) when \(n \in \{1,3,5,\ldots \}\), and \(E(x+iy) < 0\) when \(n \in \{0,2,4,6,\ldots \}\).

It follows from these observations that the set of points z in the strip \(\{x+iy:0<y<\pi \}\) where E(z) is real is the curve given by

$$\begin{aligned} \big \{\big (x(y),y\big ) :0< y < \pi \big \}, \qquad x(y) = \frac{-y\,\cos y}{\sin y}, \end{aligned}$$

and which is illustrated in Fig. 3.

Fig. 3
figure 3

The graph of \(\big (x(t),t\big )\), where \(x(t) = -t\,\cos t/\sin t\) and \(0<t<\pi \)

The visual properties of this curve can easily be obtained analytically. Obviously, \(x(y) \rightarrow -1\) as \(y\rightarrow 0+\), \(x(\pi /2) = 0\), and \(x(y) \rightarrow +\infty \) as \(y \rightarrow \pi -\). A calculation shows that

$$\begin{aligned} \frac{dx}{dy}(y) = \frac{y-\tfrac{1}{2} \sin (2y)}{\sin ^2 y} > 0 \end{aligned}$$
(4.1)

so that the function \(y \mapsto x(y)\) is increasing on \((0,\pi )\). Next, it is easy to check that E maps the curve illustrated in Fig. 3 onto the segment \((-\infty , -1/\mathrm{e}]\). Finally, as \(E\big (\overline{z}\big ) = \overline{E(z)}\), the map E is symmetric abut the real axis, and this determines the shape of the curve \(x\sin y + y\cos y\) in the range \(-\pi< y < \pi \) which bounds the region \(\varOmega _0\) that was defined earlier. Standard arguments about analytic continuation now show that there is a branch \(W_0\) of the Lambert W function which maps \({\mathcal {C}}\) conformally onto \(\varOmega _0\).

5 The Proof of Theorem 1

The Eq. (1.1) is needed for our proof of Theorem 1 and, as \(E(z) = \sum _n z^{n+1}/n!\), this follows from a standard application of the Lagrange Inversion formula (see [1, 2]). Nevertheless, it seems worth recording that it also follows much more simply from the basic formula

$$\begin{aligned} f^{-1}(w) = \frac{1}{2\pi i} \int _\gamma \frac{zf'(z)}{f(z)-w}\,dz \end{aligned}$$

which (by the Residue theorem) is valid when f is a conformal map of D onto \(D'\), \(\gamma \) is a simple closed curve in D, and w lies inside the simple closed curve \(f(\gamma )\) in \(D'\). If we take f to be \(E :\varOmega _0 \rightarrow {\mathcal {C}}\), and \(\gamma \) a simple closed curve that surrounds 0, then, for w sufficiently close to 0, we obtain

$$\begin{aligned} W_0(w) = \frac{1}{2\pi i} \int _\gamma \frac{z(1+z)\exp z}{z\exp z -w}\,dz = \frac{1}{2\pi i} \int _\gamma \frac{1+z}{1 - \frac{w}{z\exp z}} \,dz. \end{aligned}$$

By expanding the denominator as a geometric series, this becomes

$$\begin{aligned} \sum _{k=0}^\infty w^k \left[ \frac{1}{2\pi i} \int _\gamma \left( \frac{1+z}{z^k}\right) \exp (-kz)\,dz \right] , \end{aligned}$$

and (1.1) now follows by writing \(\exp (-kz)\) as a power series and then using the Residue theorem.

Proof of Theorem 1

Let g be a conformal map of the open unit disk \(\mathbb {D}\) onto \({\mathcal {C}}\) with \(g(0)=0\) and, for z in \(\mathbb {D}\), let \(F(z)=W_0\big (g(z)\big )\); see Fig. 4.

Fig. 4
figure 4

The maps g, \(W_0\) and F

Then F is a holomorphic map of \(\mathbb {D}\) onto \(\varOmega _0\), and \(F(0)=0\). It follows that for some coefficients \(a_m\) we can write

$$\begin{aligned} W_0\big (g(z)\big ) = F(z) = \sum _{m=1}^\infty a_mz^m, \end{aligned}$$

where (because F is holomorphic in \(\mathbb {D}\)) this is valid throughout \(\mathbb {D}\). If we now select any \(\zeta \) in \({\mathcal {C}}\), and put \(z = g^{-1}(\zeta )\), we have

$$\begin{aligned} W_0(\zeta ) = \sum _{m=1}^\infty a_m\,[g^{-1}(\zeta )]^m, \end{aligned}$$

and it is now simply a matter of identifying \(g^{-1}\) and the coefficients \(a_m\) to obtain (1.2).

To construct the map g, we observe that

  1. (i)

    \(z \mapsto \mathrm{e}z+1\) maps \({\mathcal {C}}\) onto \(\mathbb {C}\backslash (-\infty ,0]\);

  2. (ii)

    \(z \mapsto \sqrt{z}\) maps \(\mathbb {C}\backslash (-\infty ,0]\) onto \(\{x+iy :x > 0\}\);

  3. (iii)

    \(z \mapsto (z-1)/(z+1)\) maps \(\{x+iy :x > 0\}\) onto \(\mathbb {D}\).

It follows that g is a conformal map of \(\mathbb {D}\) onto \({\mathcal {C}}\), with \(g(0)=0\), where

$$\begin{aligned} g(z) = \frac{4z}{\mathrm{e}(z-1)^2}, \quad z \in \mathbb {D}, \end{aligned}$$

and

$$\begin{aligned} g^{-1}(\zeta ) = \frac{\sqrt{\mathrm{e}\zeta +1}-1}{\sqrt{\mathrm{e}\zeta z+1} +1}, \quad \zeta \in {\mathcal {C}}. \end{aligned}$$

Finally, we identify the coefficients \(a_m\). For any complex number \(\alpha \), and any z with \(|z|<1\), we have

$$\begin{aligned} \frac{1}{(1-z)^\alpha } = \sum _{k=0}^\infty \left( {\begin{array}{c}k+\alpha -1\\ k\end{array}}\right) z^k. \end{aligned}$$

If we put \(\alpha = 2n\), where n is a non-negative integer, and multiply both sides by \(z^n\), we obtain

$$\begin{aligned} \left[ \frac{z}{(z-1)^2}\right] ^n = \sum _{k=0}^\infty \left( {\begin{array}{c}k+2n-1\\ k\end{array}}\right) \,z^{k+n}. \end{aligned}$$

Next, if |z| is sufficiently small, then \(|g(z)| < 1/\mathrm{e}\) so that

$$\begin{aligned} \sum _{n=1}^\infty \frac{(-n)^{n-1}}{n\,!}\left[ \frac{4z}{\mathrm{e}(z-1)^2} \right] ^n = W_0\big (g(z)\big ) = \sum _{m=1}^\infty a_mz^m. \end{aligned}$$

It follows that for all z in some neighbourhood of 0,

$$\begin{aligned} \sum _{m=1}^\infty a_m\,z^m = \sum _{n=1}^\infty \, \sum _{k=0}^\infty \frac{(-n)^{n-1}}{n\,!}\left( \frac{4}{\mathrm{e}}\right) ^n \left( {\begin{array}{c}k+2n-1\\ k\end{array}}\right) \,z^{k+n}. \end{aligned}$$

Thus

$$\begin{aligned} a_m = \sum _{k+n=m} \frac{(-n)^{n-1}}{n\,!}\left( \frac{4}{\mathrm{e}}\right) ^n \left( {\begin{array}{c}k+2n-1\\ k\end{array}}\right) = \sum _{n=1}^m \frac{(-n)^{n-1}}{n\,!}\left( \frac{4}{\mathrm{e}}\right) ^n \left( {\begin{array}{c}m+n-1\\ m-n\end{array}}\right) , \end{aligned}$$

and this completes the proof.

6 An Extension of Theorem 1

The essence of Theorem 1 is that, starting with the particular branch \((W_0,{\mathcal {C}})\) of W, we have found a representation of \(W_0\) as an infinite series that is valid throughout \({\mathcal {C}}\), and which is constructed from two pieces of information, namely

  1. (i)

    the Taylor series of \(W_0\) about the point 0 in \({\mathcal {C}}\), and

  2. (ii)

    a conformal mapping of \({\mathcal {C}}\) onto \(\mathbb {D}\).

In fact, the argument used in the proof of Theorem 1 is valid for any branch of W as we shall now show.

A branch of W is (by definition) a pair \((\widetilde{W},\widetilde{D})\) (or simply \(\widetilde{W}\) when \(\widetilde{D}\) is understood from the context), where \(\widetilde{D}\) is a simply connected region in \(\mathbb {C}\), and \(\widetilde{W}\) is a conformal bijection of \(\widetilde{D}\) onto a simply connected region D in \(\mathbb {C}\) such that the two maps \(E:D \rightarrow \widetilde{D}\) and \(\widetilde{W} :\widetilde{D} \rightarrow D\) are inverses of each other. Suppose that \((\widetilde{W},\widetilde{D})\) is a branch of W, and that \(\zeta _0 \in \widetilde{D}\). Then \(\widetilde{W}\) has an expansion, say

$$\begin{aligned} \widetilde{W}(\zeta ) = \sum _{n=0}^\infty a_n (\zeta - \zeta _0)^n, \end{aligned}$$
(6.1)

which is valid in, and only in, the largest disc with centre \(\zeta _0\) that lies in \(\widetilde{D}\). Thus, in general, the expansion (6.1) will not be valid throughout \(\widetilde{D}\). Now by the Riemann mapping theorem, there is a conformal bijection g of the open unit disc \(\mathbb {D}\) onto \(\widetilde{D}\) with \(g(0)=\zeta _0\), and this has an expansion, say

$$\begin{aligned} g(z) = \sum _{n=0}^\infty b_n z^n \end{aligned}$$
(6.2)
Fig. 5
figure 5

The maps g, \(\widetilde{W}\) and F

which is valid throughout \(\mathbb {D}\). Now let F be defined on \(\mathbb {D}\) by \(F(z)= \widetilde{W}\big (g(z)\big )\); see Fig. 5. Then \(F:\mathbb {D} \rightarrow D\) is holomorphic in \(\mathbb {D}\) so we can write

$$\begin{aligned} F(z) = \sum _{n=0}^\infty c_nz^n, \end{aligned}$$

where this is valid throughout \(\mathbb {D}\). It follows that, for all \(\zeta \) in \(\widetilde{D}\), we have

$$\begin{aligned} \widetilde{W}(\zeta ) = \sum _{n=0}^\infty c_n[g^{-1}(\zeta )]^n, \end{aligned}$$
(6.3)

and we shall now show how the coefficients \(c_n\) in (6.3) can be computed from the coefficients \(a_n\) and \(b_n\) in (6.1) and (6.2). After this, we shall consider branches of the Lambert W function other than the branch \(W_0\).

The formula for the coefficients \(c_n\) is a straightforward application of Faà di Bruno’s formula which is an identity that generalises the chain rule to higher derivatives. Explicitly, given that the composition \(f\big (g(x)\big )\) is defined, and that the functions f and g are sufficiently smooth, Faà di Bruno’s formula (in a form that is best suited to power series) is that

$$\begin{aligned} \frac{1}{n!}\frac{d^n}{dx^n}f\big (g(x)\big ) = {\sum }^* \left\{ \frac{(m_1+\cdots +m_n)!}{m_1!m_2! \cdots m_n!} \left( \frac{f^{(m_1+\cdots +m_n)}\big (g(x)\big )}{(m_1+\cdots +m_n)!}\right) \prod _{p=1}^n\left( \frac{g^{(p)}(x)}{p!} \right) ^{m_p} \right\} , \end{aligned}$$

where the sum \(\sum ^*\) is the sum over all n-tuples of non-negative integers \((m_1,\ldots ,m_n)\) that satisfy the constraint \(m_1 + 2m_2 + 3m_3 + \cdots + nm_n = n\). If we now let \(f = \widetilde{W}\) and take g to be the function defined in Sect. 1, then

$$\begin{aligned} a_n = \frac{\widetilde{W}^{(n)}(\zeta _0)}{n!}, \quad b_n = \frac{g^{(n)}(0)}{n!}, \quad c_n = \frac{F^{(0)}(0)}{n!}, \end{aligned}$$

so that

$$\begin{aligned} c_n = {\sum }^* \left\{ \frac{(m_1+\cdots +m_n)!}{m_1!m_2! \cdots m_n!} a_{m_1+\cdots +m_n}b_1^{m_1} \cdots b_n^{m_n} \right\} , \end{aligned}$$

which is a finite sum that depends only on the \(a_i\) and \(b_j\). Apparently, Faà di Bruno was neither the first to state the formula that bears his name, nor the first to prove it, and for a history of the formula we refer the reader to [8].

7 Other Branches of the Lambert Function

In this section we illustrate how the extension of Theorem 1 might be applied to branches of W other than \(W_0\). In the basic reference [4] for the Lambert W function the authors of [4] introduce a collection of (standardised) branches \(\ldots ,W_{-1},W_0,W_1,\ldots \) of W, and discuss how one can evaluate (or estimate) these branches at a given point. Briefly (we omit the details) these branches are defined by introducing branch cuts along the negative real axis. However, we prefer to illustrate the idea here by applying it to those branches of W that are obtained by introducing branch cuts along the positive real axis. From a topological perspective this seems more desirable since it provides exactly two branches at the branch point \(-1/\mathrm{e}\) of order two. In all of these cases we can compute an explicit formula for the conformal mapping g of \(\mathbb {D}\) onto the domain \(\widetilde{D}\) of the branch \(\widetilde{W}\), but as yet an explicit formula for the Taylor expansion of \(\widetilde{W}\) about some point \(\widetilde{\zeta }\) (of our choice) of \(\widetilde{D}\) does not seem to be available. Thus, in effect, our method only provides an analytic continuation of a Taylor expansion of \(\widetilde{W}\) about a point of \(\widetilde{D}\) to a series representation of \(\widetilde{W}\) that is valid throughout \(\widetilde{D}\). In this context, the branch \(W_0\) is exceptional as we do know the Taylor expansion of \(W_0\) about the origin.

In order to find branches of W, we need the monodromy theorem: if a single-valued analytic function can be continued analytically over all curves in a simply connected region then the resulting function is single-valued in that region ([9]). In the case of the multi-valued function W, it is clear that every local branch of W extends univalently to any simply connected domain which does not contain 0 or \(\infty \) (the asymptotic values of E) or the unique critical value \(-1/\mathrm{e}\).

Fig. 6
figure 6

The domain of \(E(z) = z\exp \,z\)

Following the ideas in [4], we partition \(\mathbb {C}\) into a collection of mutually disjoint, non-overlapping regions as illustrated in Fig. 6. The curves \(\Gamma _j\), \(j = -1,1,-2,2,\ldots \), constitute the inverse images under E of the positive real axis with

$$\begin{aligned} \lim _{x \rightarrow -\infty ,\,z \in \Gamma _j} \ E(z) = 0, \quad \lim _{x \rightarrow +\infty ,\,z \in \Gamma _j} \ E(z) = +\infty . \end{aligned}$$

As before, the curves \(\Gamma _0^+\) and \(\Gamma _0^-\) (lying above and below the real axis, respectively) are mapped by E onto the segment \((-\infty , -1/\mathrm{e}]\) of the real axis. Each of the regions \(\varOmega _j\), \(j= -1,1,-2,2,\ldots \) are mapped by E onto the region \(\mathbb {C}\backslash [0,+\infty )\) and (exactly as for \({\mathcal {C}}\)) it is easy to find a conformal map of \(\mathbb {D}\) onto \(\mathbb {C}\backslash [0,+\infty )\). We have already discussed the region \(\varOmega _0\) above, so it remains to consider the region \(\varOmega _\infty \) as illustrated in Fig. 6. Now E is a conformal map of the region \(\varOmega _\infty \) onto the complex plane cut along the positive real axis and along the segment \((-\infty ,-1/\mathrm{e}]\); explicitly,

$$\begin{aligned} E\big (\varOmega _\infty \big ) = \mathbb {C}_\infty \backslash K, \quad K = (-\infty ,-1/E] \cup [0,+\infty ) \cup \{\infty \}, \end{aligned}$$

and when viewed from the perspective of the extended plane \(\mathbb {C}_\infty \) this is simply \(\mathbb {C}_\infty \) with a single cut from 0, through \(\infty \), and on to \(-1/\mathrm{e}\). This region is mapped onto the plane cut along the negative real axis by a suitable Möbius map, and it is now clear that we can find an explicit formula for a conformal map of \(\mathbb {D}\) onto \(\mathbb {C}_\infty \backslash K\). We leave the details of this argument to the reader. Finally, the analytic and geometric details concerning the curves \(\Gamma _j\) can be found in a similar manner to the boundary of \(\varOmega _0\) (see Sect. 4), and these details are also left to the reader.