second, it has uncovered a signicant history, hitherto unno- W (z)eW (z) = z : (1)
ticed because the lack of a standard name meant that most
researchers were unaware of previous work
and, third, it has One may issue the Maple command
now stimulated current interest in this remarkable function. > plot( w*exp(w), w, w=-4..1] )
Further, many of the recent investigations have been carried
out themselves using computer algebra, often forcing further to see a graph of W (x) for real x. For x 0 there is only one
development in computer algebra. This process has not yet real branch, but for ;1=e x < 0 there are two. Complex
reached its nal state with regard to W . branches are discussed briey in section 1.3 of this paper.
Series expansions for W about various points play im- In this paper we also discuss series for the Tree function
portant roles in many studies and applications of W . Most T (z) = ;W (;z), which satises
basically they give starting values for numerical computation
of W
further, they were one of the main factors in deciding T (z)e;T (z) = z : (2)
the branch cuts for W
and in combinatorial applications
series about the origin and about the branch point are im- This form of the function often occurs in combinatorial ap-
portant. Although several series for W have already been plications.
published, it has not been realized that there are systematic
ways of developing them. 1.2 A note on notation
We here give a uniform treatment of several series expan-
sions for W (sections 2.3, 2.4, 4.4, 4.6, 4.8 and 4.11 in par- The notation W (z) and the name `the Lambert W func-
ticular contain results not previously published). We believe tion' have quickly become a standard, since the introduction
of W into Maple sometime in the 1980's and the publica-
tion of 5] in its technical report form (January 1993). As
of Maple V Release 4 the name of the function in Maple is
Intended for ISSAC '97, Maui LambertW. The reasons for naming the function after Lam-
bert are detailed in 5]. Briey, they are, rst, that Euler
clearly acknowledged Lambert in his paper \On a series of
Im(W)
5π
2 Taylor series
4π Branch k= 2 The Taylor series for W (z) about z = 0 has been known
3π since Euler's paper 9]. The series can be derived very simply
2π Branch k= 1 using the Lagrange Inversion Formula (see e.g. 3]). How-
ever, it is of historical interest to note that Lambert's deriva-
π
tion of his series pre-dates the Lagrange Inversion Formula.
We here use more modern tools, as expounded in the very
Principal
Re(W)
elegant paper 17]. But before we give the full derivation,
Branch k= 0
−π
−2π Branch k= −1 note that the rst several terms may be computed very sim-
ply in a computer algebra system by the commands (here
−3π
Branch k= −2
written in Maple for convenience)
−4π
> series(w*exp(w)-z, w)
;z + w + w + 12 w + 16 w + 241 w + O(w ) :
−5π
2 3 4 5 6
Figure 1: The ranges for the branches of the W function. > solve(", w)
Closure information is not indicated on the gure. Branches
are closed on their top boundaries. This means in particu- z ; z2 + 32 z3 ; 38 z4 + 12524 z + O(z )
5 6
2
2.1 Some series for T (z) = ;W (;z) The number of mappings from f1 2 : : : ng into itself
We have immediately that having exactly k component cycles is the coecient of yk in
tn (y) where tn (y) is the tree polynomial of order n (see 16])
X nn;1 n and is generated by
T (z) = n! z (9) X
n1 1 = t n (y ) zn : (21)
(1 ; T (z))y n0 n!
but Lagrange inversion (or the suite of polynomials treat-
ment) gives more: Comparison with (18) gives for n 1
X n;1 n+x
T (z)x = x(n + xn) ! z (10) n;1
lim tn (y) = t0n (0) = Q(nn)n! : (22)
n0 y!0 y
(cf. 14, exercise 2.3.4.4{29]). In particular, for integer k we These series and others may be found in 16], where they
have are used to analyze a recurrence related to trees.
X n;k n Finally, note that using equation (13) with
T (z)k = k n (n ; 1) n !(n ; k + 1)z : (11) g(n) = Q(1 2 32 : : :
n)
n1
This gives a connection with `Q series' (see 14]): if = F 1 2 11 ; n ;n (23)
g(n) = Q(a1 a2 a3 : : :
n) where the hypergeometric function F is written using the
notation of 10], allows us to write series expansions for any
= a1 + a2 n ; 1 n;1n;2
n + a3 n n + (12) rational function of T (z), by rst expanding in partial frac-
tions.
then
X g(n)nn;1 z n 2.2 Taylor series for W (exp x)
a1 T (z) + 21 a2 T (z)2 + 13 a3 T (z)3 + = n! :
n1 The equation
(13) y + ln y = z (24)
This follows on substitution of equation (11) and rearrang- often occurs in applications. Its solution in terms of W is
ing. Since Q(1 2 3 : : :
n) = n, an immediate consequence (ignoring branches for the moment) y = W (exp z), which in
is some ways is a nicer function than W (z). For one thing, its
1 = X nn z n : (14) derivatives are slightly simpler, and without much diculty
1 ; T (z) n0 n! one can establish by induction that for n 1
Similarly, Q(2 12 3 22 4 32 : : :
n) = 2n2 and hence dn W (ez ) = qn (W (ez )) (25)
X nn+1 z n dzn (1 + W (ez ))2n;1
T (z)
(1 ; T (z))3 = n1 n! : (15) where the polynomials qn (w) are given by
n;1
X
Note also that (1+x=n)n;1 = Q(1 x=1! x2 =2! : : :
n), which qn (w) = n;1 (;1)k wk+1 : (26)
yields the identity k=0
k
X n;1 n
exT (z) = x(n + nx!) z : (16) These polynomials have coecients expressed in terms of
second-order Eulerian numbers 10]. See section 4.1 for re-
n0 currence relations for these numbers. The qn (w) may be
We have essentially seenx this before (in equation (10)), since computed from the recurrence relation 5]
exp(xT (z)) = (T (z)=z) . In its new form it makes sense for qn+1 (w) = ;(2n ; 1)wqn (w) + (w + w2 )qn0 (w) : (27)
complex x.
Let Q(n) = Q(1 1 1 : : :
n) be Ramanujan's function Discovering formulas (25{26) in the rst place is another
matter, of course, and it is here that computation of the rst
Q(n) = 1 + n ; 1 n;1n;2
n + n n + : (17) several derivatives can point the way.
Then > alias( w = LambertW( exp(z) ) )
> seq( normal(diff( w, z$n)), n=1..5)
X nn;1 Q(n)z n
ln 1 ; 1T (z) = n! (18)
n1
X nn Q(n)zn 1 +w w (1 +ww)3 ; w ((1;+
1 + 2 w)
w)5
T (z) = (19)
(1 ; T (z))2 n1
n! w (1 ; 8 w + 6 w )
2
(1 + w)7
T (z) + T (z)2 = X nn+1 Q(n)zn : (20) ; w (;1 + 22(1w +; w58)9w + 24 w ) ]
2 3
(1 ; T (z))4 n1
n!
3
As before, when w = W (exp a) is rational the Taylor Getting Maple to evaluate this integral requires explicit use
series for W (exp z) about z = a has rational coecients. of changevar and assumptions on s. The requisite substi-
For example, this occurs when a = 1, giving tution is w = W (exp(1 + z)) so dz = (1 + w)dw=w and
exp z = w exp(w ; 1).
W (ez ) = 1 + 12 (z ; 1) + 16
1 (z ; 1)2 ; 1 (z ; 1)3 ;
192 The e ect of the Laplace transform, as can be veried
1 (z ; 1)4 + 13 (z ; 1)5 + O((z ; 1)6 ) : (28) with Watson's lemma 1], is to convert an exponential gen-
erating function into an ordinary generating function (in
3072 61440 1=s
one can keep the same
R form of the power series by us-
p ing the Borel transform 01 exp(;t)f (st) dt, but this is only
This series has radius of convergence 4 + 2 , which is
the distance to the nearest singularity at z = ;1 + i . This trivially di erent).
gives the asymptotics of qn (1). Since we can evaluate the Laplace transform of W (exp z)
it is no surprise that we can evaluate the Mellin transform
2.3 Branches in equation (24) of W (z). The result is
Theorem: The unique solution of y + ln y = z is Z1
M (W (z)) = xs;1 W (x) dx
y = W;K(z)(ez ) (29) 0
;s
where K(z) is the unwinding number of z (see 6]), unless
z = t + i for ;1 < t ;1, in which case there are exactly = (;s) s ;(s) (34)
two solutions, y = W;1 (exp z) and y = W0 (exp z). for ;1 < <(s) < 0. Again explicit use of changevar and as-
Proof. Taking exponentials of both sides of y + ln y = z sumptions are necessary to get Maple to evaluate this trans-
we see that if y is a solution, then y = Wk (exp z) for some k. form.
To go in the other direction, we use the relation
Wk (z) + ln Wk (z) = ln z + 2 ik (30) 3 Series about the branch point
unless k = ;1 and z 2 ;1=e 0), when W;1 (z) + p
ln W;1 (z) = ln z. For a proof of this relation see 12]. We If we put p = 2(ez + 1) in W exp W = z, and expand in
replace z in the above by exp z, and since powers of 1 + W and revert, we obtain
ln ez = z + 2 iK(z) (31) X
W0 (z) =
` p` = ;1 + p ; 13 p2 + 72 p + :
11 3
(35)
(indeed this denes the unwinding number K(z), see 6]), we `0
have that
Wk (ez ) + ln Wk (ez ) = z + 2 i (K(z) + k) (32) This series is well-known and has many combinatorial ap-
plications (see for example 16]). It converges for jpj < 21=2 .
unless k = ;1 and exp z 2 ;1=e 0), in which case we The coecients may be computed by the following recur-
replace k by 0 on the right hand side of (32). Thus we rence relations, which were communicated to us by Don
have that Wk (exp z) + ln Wk (exp z) = z if and only if Coppersmith.
k = ;K(z), unless k = ;1, as claimed. It is easy to see
that both k = ;1 and k = 0 work if z = t + i for some
k = kk ; 1 ;1
t 2 (;1 ;1] as claimed, and because the unwinding num- 1
+ 1 2
k;2 + 4 k;2 ; 2 k ; k+1
k;1
1 1
4
> op({solve(series(subs(w=-1+u, z=-exp(-1) and the series for T0 is the same but with alternating signs.
+ t^2* exp(-1),w*exp(w)-z),u),u)})
This gives at last that
p X
n! = 2 nnn e;n 1 3 5 n k(2k + 1) a2k+1 : (44)
p p 3 43 4 769 p 5
2 t ; 32 t2 + 11
36 2 t ; 135 t + 4320 2 t
k 0
1768 t6 + O(t7 ) The following Maple procedure implements the recur-
; 8505 rence relation derived in 19] for the ak .
p p 3 43 4 769 p 5
; 2 t ; 32 t2 ; 11
36 2 t ; 135 t ; 4320 2 t
a := proc(n) option remember
local k
; 1768
8505 t + O(t )
6 7 1/(n+1)/a(1)*(a(n-1) -
add( k*a(k)*a(n+1-k), k=2..n-1))
end:
where t = (1 + ez)1=2 . Now, since the singularity a(0) := 1
is isolated, it is possible to use Darboux's theorem a(1) := 1
which says that the asymptotic expansion of the
n-th Taylor coecient of W at the origin is ob- The choice a(1) = 1 gives the series for v, whilst a(1) = ;1
tained by taking the coecients term by term in gives the series for u. In more mathematical notation, their
the above equation. In other words (considering recurrence relation is
only the rst order term):
a0 = 1 (45)
(;n)n = (p;e)n (37) a1 =
1 (46)
n! 2 n
n;1 !
X
which is Stirling's formula. : : :] I heard it a few an = (n +11)a an;1 ; kak an+1;k : (47)
years ago from Philippe Flajolet. 1
k=2
The connection between series at the branch point for W The rst few terms are v = T;1 (e;1;z2 =2 ) =
and Stirling's formula for n! is made explicit in 19], who use
elementary arguments, and R we paraphrase their results be-
low. Starting from n! = 01 xn exp(;x) dx, changing vari- 1 + z + 13 z2 + 36
1 z3 ; 1 z4
270
ables to y = x=n and splitting the range of integration into 1 1
+ 4320 z + 17010 z ; 5443200
5 6 139 z7
0 1] and 1 1], they get
Z 1 Z1 + 2041201 z8 ; 571 z9
n! = nn+1 e;n (ue1;u )n du + (ve1;v )n dv : (38) 2351462400
0 1 281 163879 z11
; 1515591000 z10 + 2172751257600
They then make ad hoc substitutions
here we use our
knowledge of W and its branches to repeat their work. + O(z12 ) : (48)
Putting Since the nearest other singularity is at z = 1, this series
converges for all nite z.
u = T0 e;1;z =2
2
and (39)
3.2 Other branch point series
v = T;1 e;1;z =
2 2
(40)
The relation between W;1 and W0 near the branch point
we arrive at was studied by Karamata in 13], who studied the coe-
Z1 cients in the power series
n! = nn+1 e;n ze;nz2 =2 1 ; 1
T;1 1 ; T0 dz : (41)
X
0
1 ;
= + 23 2 + 49 3 + = cn n (49)
Note that z = 0 corresponds to the branch point of T . We n1
use the T notation to keep minus signs to a minimum. We
being the solution to
now expand the expression in brackets about z = 0 (it is
more convenient to use the series for du and dv directly, as (1 +
)e; = (1 ; )e : (50)
was done in 19], than to rearrange the geometric series for
1=(1 ; T ) in (41)), integrate term by term, and arrive at the In terms of T , the solutions are
asymptotic expansion for n! in the form 8 ;
X k+1=2 < T0 (1 ; )e;(1;)
n! = nn+1 e;n (2k + 1)a2k+1 n2 ;(k + 1=2) (42) 1+
=
: T;1 ;(1 ; )e;(1;)
(51)
k 0
where X where if > 0 then T0 simplies to 1 ; and gives
= ;
T;1 (e;1;z2 =2 ) = an zn (43) but T;1 does not simplify, whilst if < 0 then T;1 simplies
n0 to 1 ; but T0 does not. Karamata has developed a series
5
for the root that does not simplify. Using the di erential We also make use of r-associated Stirling subset numbers
equation (we use only the case r = 2), which are generated by
d
= 1 ; 1 (1 +
) (52) r ;1 k
d 1; (ez ;
X z )m = m! X n n o zn : (61)
it is easy to derive the recurrence relation k=0
k! n0
m r n!
" n;1 #
X Finally, we need the second-order Eulerian numbers. As
cn = n +1 1 2 + cj (1 ; jcn;j+1 ) (53) before we follow 10]. The numbers are dened as follows.
j =2
which is valid for n 2 if the sum is taken to be 0 if empty. n = 1 if n = 0 (62)
An interesting parametric description of the real n 0 otherwise
branches of W is contained in 18]. If we put
n = 1 (63)
p = 12 (W0 (z) ; W;1 (z)) (54) 0
then 18] gives n = (k + 1) n ; 1
k k
z = ;pe;p coth p cosech p (55)
n ;
+ (2n ; 1 ; k) k ; 1 :1 (64)
W0 (z) = ;pepcosech p (56)
; p
W;1 (z) = ;pe cosech p (57)
and expands these in series containing Bernoulli numbers. 4.2 The fundamental relation
The connection with Karamata's work is that If we start with W (z) exp(W (z)) = z, then by putting
p = ( +
)=2 (58) W (z) = ln z ; ln ln z + u (which denes u for any z 6= 0,
but which makes particularly good sense if z is large) we get
though it is not clear at this writing if this gives us any new
information. (ln z ; ln ln z + u) lnzz eu = z (65)
and since z 6= 0 we may divide both sides by z, and put
4 Series about Innity = 1= ln z and
= ln ln z= ln z to get
We collect and present the previously known series for 1 ;
+ u = e;u : (66)
W (z) about innity, which go back to de Bruijn 8] and
to Comtet 4]. We then show that these known series are This is what we call the fundamental relation, and we will
members of an innite family of series (some of these were see some of its consequences in what follows. Note that this
exhibited in 5, 11]), and show that they are valid as z ! 0 same equation, mutatis mutandis, arises if we replace Wk (z)
as well as for z ! 1. Finally we exhibit some new se- by lnk z ; ln lnk z + u(k) , where lnk (z) = ln(z) + 2 ik is the
ries, including an expansion for W ( exp(it)) in terms of notation introduced in 12] for the k-th logarithm branch.
W () and it which separates the real and imaginary parts
of W ( exp(it)). 4.3 de Bruijn and Comtet's expansion
4.1 Stirling and Eulerian numbers de Bruijn solved the fundamental equation (66) in series to
show that the asymptotic expansion of W (x) for large x is
To x notation, we summarize
with generating functions. in fact convergent 8]. Comtet later identied the coe-
Stirling cycle numbers mn are generated (for example) cients explicitly as Stirling numbers 4]. The result is (ex-
by 10] plicitly adding branch information which Comtet did not
use, and specically excluding the case where k = ;1 and
X h n i zn z 2 ;1=e 0) where another expansion holds)
lnm (1 + z) = m! (;1)n+m m n! : (59)
n0
Wk (z) = lnk (z) ; ln lnk (z)
The numbers (;1)n+m mn are also called Stirling numbers X X (ln lnk (z ))m
+ c`m (67)
of the rst kind. See 15] for a discussion of the advantages `0 m1 (lnk z)`+m
of the notation used here.
The Stirling subset numbers mn , which are also called where c`m = m1! (;1)` ``++1m is expressed in terms of Stir-
Stirling numbers of the second kind, are generated (for ex- ling cycle numbers. This (absolutely convergent for large
ample) by X n n o zn enough z) doubly innite series can then be rearranged to
(ez ; 1)m = m! get
m n! : (60)
n0 Wk (z) = lnk z ; ln lnk z (68)
Recurrence relations (and much more) for these numbers X (;1)n X n h i m
+ (ln z)n (;1)m n ; m n (ln lnk z) :
may be found in 10]. k + 1 m!
n1 m=1
6
These series were further developed and rearranged inn v while the numerator is degree n ; 1, and because the
in 11] using the new variable = 1=(1 + ) to get p terms grow more slowly). Thus this series again gives
the correct asymptotics. These observations were used in
Wk (z) = lnk z ; ln lnk z (69) section 4.3 to extend Comtet's series to arbitrary branches
X
m mX ;1 of W .
+ m ! (;1)p+m;1 p+m p + mp ; 1 The following Maple session shows the rst few terms of
m1 p=0 2 this new series (75).
> basic := 1 - tau + sigma*u - exp(-u)
and a further series which we will discuss below.
basic := 1 ;
+ u ; e(;u)
4.4 A new series > subs(sigma=1/v,tau=-p/v,")
The fundamental equation (66) may be solved for u, for any
and
, not just the values used here, in terms of W . The 1 + vp + uv ; e(;u)
solution is
u = W ( 1 e(1; )= ) ; 1 ;
: (70) > series(",u)
7
In the case n ! 1, one can show that vn ! W (z) if and we will have W (z) = W (v exp(v + p)) so we may
jW (z)j > 1, while vn ! W (z) in jW (z)j < 1 if n ! ;1. use (75). This gives us many interesting new series for W ,
In fact this iteration turns out to be completely equiva- but it also gives us a family of iterative formulas for W ,
lent to the well-studied exponential iteration dening which can be of arbitrary order, as follows. We choose k = 0
because we want p ! 0.
zz
z
8
More generally, for any b and c and any power series 6 A Final Pair of Expansions
X
G(x) = ai xi (90) The iterations (76{77) may be used to show that W (z) can
i0 be written as
W (z) = z (98)
with a0 6= 0, the following expansion holds: exp z
z
1 b c;b X An (ln ln z )
exp
9
12] Jeffrey, D. J., Hare, D. E. G., and Corless,
R. M. \Unwinding the branches of the Lambert W
function". Mathematical Scientist 21 (1996), 1{7.
13] Karamata, J. \Sur quelques probl$emes pos#es par Ra-
manujan". J. Indian Math. Soc. 24 (1960), 343{365.
14] Knuth, D. E. The Art of Computer Programming,
2nd edition, vol. I. Addison-Wesley, 1973.
15] Knuth, D. E. \Two notes on notation". American
Mathematical Monthly 99 (1992), 403{422.
16] Knuth, D. E., and Pittel, B. \A recurrence related
to trees". Proc. Amer. Math. Soc. 105 (1989), 335{349.
17] Labelle, G. \Sur l'inversion et l'it#eration continue des
s#eries formelles". European Journal of Combinatorics
1 (1980), 113{138.
18] Lauwerier, H. A. \The asymptotic expansion
of the statistical distribution of N. V. Smirnov".
Z. Wahrscheinlichkeitstheorie 2 (1963), 61{68.
19] Marsaglia, G., and Marsaglia, J. C. \A new
derivation of Stirling's approximation to n!". Ameri-
can Mathematical Monthly 97 (1990), 826{829.
20] Murnaghan, F. D. \Airey's converging factor". Proc.
Nat. Acad. Sci. USA 69 (1972), 440{441.
21] Salvy, B. \Fast computation of some asymptotic func-
tional inverses". Journal of Symbolic Computation 17
(1994), 227{236.
10