1 Introduction

The function \(E :z \mapsto z\exp z\) is holomorphic throughout the complex plane, \(E'(z)=0\) if and only if \(z = -1\), and \(E(z)=0\) if and only if \(z=0\). However, for any non-zero complex number a, the equation \(E(z)=a\) has infinitely many solutions, and the (multi-valued) inverse W of E is known as the Lambert W function. We refer the reader to [3,4,5] for the basic properties of W, and many examples of its use in a variety of different problems. There is a standard construction, and labelling, of a particular set \(\ldots ,W_{-1},W_0,W_1, \ldots \) of branches of W which are defined in [4, 5], and illustrated below, and which we now describe. First, \({\mathbb {C}}\) is the complex plane, and

$$\begin{aligned} {\mathscr {C}} = {\mathbb {C}}\backslash (-\infty ,0], \quad \mathrm{{\mathcal {E}}} = {\mathbb {C}}\backslash (-\infty ,-1/e], \end{aligned}$$

so that \({\mathscr {C}}\) is the complex plane cut along the interval \((-\infty ,0]\), and \(\mathrm{{\mathcal {E}}}\) is the complex plane cut along the interval \((-\infty ,-1/e]\). The branch \(W_0\) is a conformal map of \(\mathrm{{\mathcal {E}}}\) onto the region labelled \(W_0(\mathscr {E)}\) in Fig. 1 and, for each non-zero integer k, the branch \(W_k\) is a conformal map of \({\mathscr {C}}\) onto the region labelled \(W_k({\mathscr {C}})\) in Fig. 1.

Fig. 1
figure 1

The codomains of the branches \(W_k\)

Except for a representation of \(W_0\) as an infinite series that is valid throughout \(\mathrm{{\mathcal {E}}}\) (see [3]), no explict formula for \(W_k\) is known, and the purpose of [5] was to present the following result which can be used in computer algebra systems to make computations involving the various branches \(W_k\). As usual, \(\ln (z)\) is the principal branch of the complex logarithm defined for all non-zero z by \(\ln (z) = \ln |z| + i\theta (z)\), where here, \(\ln |z|\) is the real logarithm, and \(\theta \)(z) is the unique choice of the argument of z in the interval \((-\pi ,\pi ]\).

Theorem 1

[5] Let \(W_k\) be the branches of the Lambert function as defined in [4, 5]. Then

$$\begin{aligned} W_k(z) + \ln \big (W_k(z)\big ) = {\left\{ \begin{array}{ll} \ln (z) &{}\text {if}\,\,\, k = -1 \,\text {and}\, z \in [-1/e,0);\\ \ln (z) + 2\pi ki &{}\text {otherwise.} \end{array}\right. } \end{aligned}$$
(1.1)

The idea of the unwinding number of a complex variable was introduced in [5, 6] in order to accommodate computations involving complex numbers in various computer algebra systems. The discussions there focussed on the problem of computing multi-valued functions such as the complex logarithm and the inverse trigonometric functions and, in particular, on providing automatic computations near the discontinuities that occur on the branch cuts of these functions. In particular, the authors of [5, 6] used the idea of the unwinding number in their proof of Theorem 1. In Sect. 2 we consider Theorem 1 from the perspective of conformal mapping, and we provide a self-contained, topological, proof which does not use the unwinding number.

Although the reason for the choice of the name unwinding number is hinted at in [6], its connection to the fundamental and well established notion of the winding number of a curve in the complex plane seems not to have been described explicitly in the literature, and it is even claimed in one publication that the concept of the unwinding number has no connection with the winding number of a curve. This is plainly false (the unwinding number actually is the winding number of a certain curve); indeed, any complete treatment of multi-valued functions, holomorphic functions, Cauchy’s theorem, and so on, necessarily, and inevitably, involves the topological notion of the winding number of a curve in one (perhaps hidden) form or another, and the entire subject of complex analysis can even be developed topologically from the single concept of the winding number of a curve without ever mentioning an integral [1, 2]. In Sect. 3 we give a brief description of the unwinding number from a topological perspective.

2 A Proof of Theorem 1

We present a topological proof of Theorem 1 (which is different from the proof in [6]); then we consider the result from the perspective of conformal maps.

Proof

Consider a branch \(W_k\), where k is a non-zero integer. Since the functions z and \(W_k(z)\) are continuous and non-zero in the simply connected region \({\mathscr {C}}\), it is a topological fact that the functions \(\ln (z)\) and \(\ln W_k(z)\) are defined, single-valued, and continuous, on \({\mathscr {C}}\). Thus \(\ln (z)-\ln W_k(z)\) is a single-valued, continuous, choice of \(\log \big (z/W_k(z)\big )\) in \({\mathscr {C}}\). Now \(\exp W_k(z) = z/W_k(z)\) in \({\mathscr {C}}\), and it follows from this that each of the two functions \(\ln (z)-\ln W_k(z)\) and \(W_k(z)\) are a single-valued, continuous, choice of \(\log \big (\exp W_k(z)\big )\) in \({\mathscr {C}}\). It follows that there is some integer p such that

$$\begin{aligned} \Big [\ln (z)-\ln W_k(z)\Big ] - W_k(z) = 2p\pi i, \quad z \in {\mathscr {C}}. \end{aligned}$$

As \(E(2\pi ik) = 2\pi ik\), we see that \(2\pi ik\) is a fixed point of \(W_k\), and this shows that \(p=-k\). This completes the proof for \(k \ne 0\). The proof for \(W_0\) follows in a similar way because \(z/W_0(z)\) (which has a removable singularity at \(z=0\)) is non-zero throughout \(\mathrm{{\mathcal {E}}}\). Finally, it is sufficient to establish (1.1) with \(k \ne 0\) when \(z\in {\mathscr {C}}\), and with \(k=0\) when \(z \in \mathrm{{\mathcal {E}}}\), for the values of \(W_k\) on the boundary of its domain are uniquely determined by continuity from within its domain. \(\square \)

Theorem 1 can be viewed entirely in terms of conformal maps, and this provides a more visual way of thinking about the different branches \(W_k\). To begin, the left-hand side of (1.1) is the map \(z \mapsto F\big (W_k(z)\big )\), where \(F(z) = z + \ln z\), and the codomain of \(W_k\) lies in the domain of F. Thus, to understand (1.1) we need to know about F, and it is known that F maps \({\mathscr {C}}\) onto the complex plane cut along the two half-lines given by \(\{x+iy :x \le -1,\; y=\pi \}\) and \(\{x+iy :x \le -1,\; y=-\pi \}\) (see [8] and Fig. 2)

Fig. 2
figure 2

The conformal map \(F :z \mapsto z + \ln (z)\)

For brevity, we shall only consider \(W_2\), and the following result (illustrated in Fig. 3) is simply a reformulation of Theorem 1.

Theorem 2

The map \(z \mapsto z+ \ln (z)\) provides a conformal map of \(W_2({\mathscr {C}})\) onto the strip \(\{x+iy :3\pi< y < 5\pi \}\).

Fig. 3
figure 3

The conformal map of \(W_2({\mathscr {C}})\) onto the strip \(\Sigma = \{x+iy:3\pi< y < 5\pi \}\)

The point of Theorem 2 is this: from the perspective of complex analysis, there is essentially no difference between the cut plane \({\mathscr {C}}\) and a (conformally equivalent) infinite strip \(\Sigma \); thus it is more natural to study a conformal map between a horizontal strip \(\Sigma \) and \(W_2({\mathscr {C}})\) (than a conformal map between \({\mathscr {C}}\) and \(W_2({\mathscr {C}})\)) because \(\Sigma \) and \(W_2({\mathscr {C}})\) have a similar geometric shape. Theorem 2 shows that the map from \(W_2({\mathscr {C}})\) to the given strip \(\Sigma \) is a perturbation of the identity map by an amount \(\ln (z)\) which, for z in \(W_2({\mathscr {C}})\), has imaginary part between \(-\pi \) and 0. Thus this gives a visual explanation of the fact that \(W_2({\mathscr {C}})\) approximates the strip \(\{2\pi< y < 4\pi \}\) at its left-hand end, and the strip \(\{3\pi< y < 5\pi \}\) at its right-hand end.

3 The Unwinding Number

In order to create a single-valued choice of the logarithm it is necessary to introduce a branch cut, but this has undesirable consequences for computations since, in general, familiar algebraic identities will fail near these branch cuts. For example, in many cases \(\ln (z_1z_2) = \ln z_1 + \ln z_2\), but in some cases (for example, when \(z_1 = z_2 = -1\)) we have \(\ln (z_1z_2) \ne \ln (z_1)+\ln (z_2)\). The unwinding number \({\mathscr {K}}(z)\) of a complex number z was introduced in [5, 6] in order to resolve these difficulties in a way that makes it possible to engage automatic computing of multi-valued complex functions in various computer algebra systems. Indeed, with the unwinding number \({\mathscr {K}}(z)\) available, we have, for example,

$$\begin{aligned} \ln (z_1z_2) = \ln (z_1)+\ln (z_2) +2\pi i {\mathscr {K}}(\ln z_1 + \ln z_2) \end{aligned}$$
(3.1)

for all non-zero \(z_1\) and \(z_2\). The discussions in [5, 6] focussed on the problem of providing automatic computations near the discontinuities that occur on the branch cuts of these functions. In particular, the authors used their idea of the unwinding to give a proof of Theorem 1. Here, we give a brief description of the unwinding number from a topological perspective.

We now consider, with p an integer, the three regions

$$\begin{aligned} \Omega&= {\mathbb {C}}\backslash (-\infty ,0];\\ S&= \{x+iy :-\pi< y< \pi \}; \\ S_p&= \{x+iy :(2p-1)\pi< y < (2p+1)\pi \}, \end{aligned}$$

in \({\mathbb {C}}\) which are illustrated in Fig. 4, and three conformal maps between these regions, namely

$$\begin{aligned} E:S_p \rightarrow \Omega , \quad L:\Omega \rightarrow S, \quad T:S \rightarrow S_p, \end{aligned}$$

where \(E(z) = \exp z\), \(L(z) = \ln (z)\) and \(T(z) = z + 2\pi ip\). Trivially, \(ETL(z)=z\) on \(\Omega \), where we denote the composition of functions by juxtaposition so that \(fg(z) = f\big (g(z)\big )\). It follows that \(TLE(z)=z\) on \(S_p\), so that

$$\begin{aligned} \ln (\exp z) = T^{-1}(z) = z-2\pi ip, \quad z \in S_p. \end{aligned}$$

According to [6], this means that \(-p = {\mathscr {K}}(z)\), so that

$$\begin{aligned} \ln (\exp z) = z + 2\pi i{\mathscr {K}}(z), \end{aligned}$$

which is the definition of \({\mathscr {K}}(z)\) in [6]. Note that if we put \(z = \ln z_1+ \ln z_2\) then (3.1) follows immediately.

Now suppose \(z \in S_p\), and let \(\gamma \) be the (vertical) straight line segment from \(z-2\pi ip\) in S to z in \(S_p\), parametrized by \(\gamma (t) = (z-2\pi ip)+ 2\pi ipt\), where \(t \in [0,1]\). As the image \(\Gamma \) of \(\gamma \) under the exponential map is a circle with centre 0 that is traversed exactly p times, we see that \(n(\Gamma ,0)=p\) (where, as usual, \(n(\Gamma ,0)\) is the winding number of the curve \(\Gamma \) about 0) so that

$$\begin{aligned} {\mathscr {K}}(z) = n(\Gamma ,0). \end{aligned}$$

It follows that various formulae involving the unwinding number (such as those found in [4,5,6]) can be considered to be algebraic descriptions of topological properties of curves in the plane.

4 An Integral Formula for the Function \(W_2(z)\)

We end with an expression for \(W_2(z)\) as a line integral, and for this we shall need the following (known) general result.

Theorem 3

Let F be a bijective conformal map of a simply connected region D onto a simple connected region \(D'\). Let \(\gamma \) be a simple closed curve in D, and \(F(\gamma )\) its image in \(D'\). Suppose that \(z_0\) is inside \(\gamma \), and \(w_0 = F(z_0)\); then \(w_0\) is inside \(\Gamma \), and

$$\begin{aligned} F^{-1}(w_0) = \frac{1}{2\pi i}\int _\gamma \frac{zF'(z)}{F(z)-w_0} \, dz. \end{aligned}$$
Fig. 4
figure 4

The unwinding number

The proof is by the Residue theorem, for \(z_0\) is the only singularity of the integrand that is inside \(\gamma \), and this is a simple pole with residue R, where

$$\begin{aligned} R = \lim _{z\rightarrow z_0} \frac{(z-z_0)zF'(z)}{F(z)-w_0} = \frac{z_0F'(z_0)}{F'(z_0)} = z_0 = F^{-1}(w_0). \end{aligned}$$

Of course, the integral is zero if \(z_0\) is outside \(\gamma \) (equivalently, \(w_0\) is outside \(F(\gamma )\)).

We now consider Fig. 5 below: this represents the top part of Fig. 3 in which we have drawn \(z_0\), \(w_0\), \(\gamma \) and \(F(\gamma )\) (and where we are taking D and \(D'\) in Theorem 3 to be \(W_2({\mathscr {C}})\) and \(\Sigma \), respectively). According to Theorem 3, we now find that, for z in \({\mathscr {C}}\), we have

$$\begin{aligned} W_2(z) = F^{-1}\big (L(z)\big ) = \frac{1}{2\pi i}\int _\gamma \frac{\zeta F'(\zeta )}{F(\zeta )- [\ln z + 4\pi i]}\,d\zeta , \end{aligned}$$

which is the promised formula for \(W_2(z)\) as a line integral.

Fig. 5
figure 5

The conformal map of \(W_2({\mathscr {C}})\) onto \(\{x+iy:3\pi< y < 5\pi \}\)

If we take \(\gamma \) to be a small circle of radius r centred at the fixed point \(4\pi i\) of \(W_2\), so that \(\zeta = 4\pi i + re^{i\theta }\), then we obtain the formula

$$\begin{aligned} W_2(z) = \frac{1}{2\pi i}\int _0^{2\pi } \frac{1+4\pi i + re^{i\theta }}{re^{i\theta } + \ln \big (4\pi i +re^{i\theta }\big )- \ln (z)}\,ire^{i\theta }\,d\theta . \end{aligned}$$
(4.1)

which gives \(W_2(z)\) as a function of \(\ln z\). It is known [7] that

$$\begin{aligned} \frac{d^n W_2}{dz^n}(4i\pi ) = \frac{P_n(4i\pi )}{(1+4i\pi )^{2n-1}}, \end{aligned}$$

where

$$\begin{aligned} P_n(z) = (-1)^{n-1}\sum _{k=0}^{n-1}P_{n,k} z^k, \end{aligned}$$

and

$$\begin{aligned} P_{n,k} = \sum _{m=0}^k \frac{1}{m\,!}\left( {\begin{array}{c}2n-1\\ k-m\end{array}}\right) \sum _{q=0}^m \left( {\begin{array}{c}m\\ q\end{array}}\right) (-1)^q (q+n)^{m+n-1}, \end{aligned}$$

and it would be interesting to see whether this can be derived from (4.1).