Applied Mathematics, 2013, 4, 887-892 http://dx.doi.org/10.4236/am.2013.46122 Published Online June 2013 (http://www.scirp.org/journal/am)
A Brief Look into the Lambert W Function
Thomas P. Dence Ashland University, Ashland, USA Email: [email protected]
Received December 4, 2012; revised March 14, 2013; accepted March 22, 2013
Copyright © 2013 Thomas P. Dence. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
ABSTRACT The Lambert W function has its origin traced back 250 years, but it’s just been in the past several decades when some of the real usefulness of the function has been brought to the attention of the scientific community.
Keywords: Lagrange Inversion Theorem; Infinite Tower of Exponents
1. Introduction defined on the entire real line, and each being one-to-one; but the product is not injective. Consequently, if we re- The Lambert W function, named after Johann Heinrich strict the domain to x 1, then xex will possess an Lambert [1], is a standard function in both Mathematica, inverse, which is a function, and it’s this function that is where it’s called Product Log x , and in Maple, where now known as the (principal) Lambert W function (Fig- you can use both Lambert W x or Lambert W0, x . ure 1(b)), written as W x . An alternative branch for The zero in this latter expression denotes the principal x x W would be defined for that portion of xe when branch of the inverse of xe . The actual usage of the letter W has a rather vague origin. One source attributes x 1. We won’t consider that situation in this article. it to some earlier papers on the subject that wrote the Several function values of W are easy to compute, wxew 1 standard equation as using a small w. Pro- such as W1 e 1,W00 . Wln2ln2, gramming protocol with Maple then forced the letter to 2 be capitalized [2]. Another source [3] attributes the W to and We 1. The value of W1 , known as the honor the British mathematician Sir Edward M. Wright omega constant, has the approximate value 0.567143. (famous co-author with G. H. Hardy of An Introduction The number W1 is, in some sense, a distant cousin of to the Theory of Numbers) who did a lot of pioneering the golden ratio , since 1 is a solution to 11x x , work with the function. Finally, Robert Corless and and W1 is the solution to 1ex x , and x 1 is the David Jeffrey of the University of Western Ontario have linear Maclaurin approximation to ex (Figure 2). Since written, during the past several decades, a number of W is the inverse of xex , it follows that W1e W11 journal articles on the function. Their paper in 1996, in and that the slope of the curve in Figure 1(b) at the point 1 collaboration with Gaston Gonnet, David Hare, and Don- W1 1, W 1 is 1 e 0.6381. ald Knuth, was where Lambert’s name got attached to the function [2]. It could have been coined the Euler W function, since Euler had studied the equation xex 3. Computation [4] (although Euler credits Lambert as studying the equa- A natural question is how to compute arbitrary values of tion first [5]), but they decided Euler had enough items W x . One result, from the Lagrange inversion theorem, attached to his name! asserts that the Lambert W function has the Taylor series expansion [6,7] 2. Definition n1 x n The exponential function y xe is defined for all real Wx xn , (1) 1 n1 n! x, but has a codomain of y . This function (Figure e which, unfortunately, has a radius of convergence of 1(a)) is the product of two elementary functions, each merely 1 e . Since the denominator n! grows rapidly it’s
Copyright © 2013 SciRes. AM 888 T. P. DENCE
advantageous to write the series with the coefficients n defined recursively as W x cxn , with n1 n2 n cc11, nn cn1, 2 . This recursion lends n 1 itself to easy programming evaluation. Testing this, with say a series of 150 terms (which is plenty, considering 1 1 that x ), with x ln 2 0.3465736 , we ob- e 2 tain a partial sum value of S 0.69314684 , which dif- fers from the exact value of ln 2 by 0.0000003. We 1 also note that x , so the use of the series is justified. e On the other hand, a TI-graphing calculator returns “overflow error” if we try to determine W1, primarily (a) since the coefficients grow rapidly. 1 Suppose that x and we wish to compute W x . e One possibility is the series
n 1 Wlnlnlnx xx n an x (2) n1 ln x
m n m ln ln x where axn 1S, nnm 1 and m1 m! S,nk denotes a Stirling number of the first kind [3]. The series (2) is somewhat impractical to use because of (b) the difficulty in determining axn ; it turns out to be Figure 1. (a) Graph of y xe x ; (b) Graph of W(x), more useful to employ some standard numerical schemes 1 for approximating W x . x . y e First, setting W x y , we need to solve ye x . y Defining the function g by g yye x, we use Newton’s method to approximate y in gy 0 . This 2 yn gy n yxn e gives yynn1 . To determine gynny1 W2 , for example, starting with an initial approximate
of y0 0 , after 7 more iterations we get
y8 0.852605502 , which is an excellent approximation y8 to W2 because y8e returns 2 on the calculator. If x is a relatively small number, then an initial approximate of 0 will suffice for the algorithm; but if x is large, then
ln x can be chosen for y0 . For instance, if x 10 ,
choose y0 ln 10 , and after 5 iterations we get W(10) ≈ 1.745528003. Newton’s method is a favorite iteration scheme for many because of its simplicity, though the convergence, quadratic in general, is typically relatively slow. A faster choice is furnished by Halley’s method (of Halley’s comet fame), which produces cubic convergence, and
happens to be the choice implemented by the software Figure 2. W1 and 1 . Maple; this scheme gives [8]
Copyright © 2013 SciRes. AM T. P. DENCE 889
yn 2W yxne eW2 yynn1 . Rewriting W as puts this into yyx2eyn 3 y nn 1W y 1en n n 22yn the form which fits the general case for W [5]. In Employing this gives W(10) ≈ 1.745528003 after 3 it- fact, from this form, we readily see that there is a point of erations. This complex looking scheme is actually what inflection on the curve when W2, which actually you get when you apply Newton’s method to the function falls on the other branch of the W function. g x Continuing along the calculus vein, we should exam- [9]. An alternative root-finding scheme, using ine, if possible, the integral of W x . To this end, recall gx that y W x iff ye y x . Thus, continued fraction expansion, is described in [10]. ddyyy Wdx xyx 1W x WW xx 4. Calculus
x yy2 We know that since y xe is an increasing and dif- yyeed y ferentiable function for all x 1 then its inverse y W x is likewise increasing and differentiable for and integrating this last integral by parts, we obtain 1 1 all x . xy 1 , which now gives e y Differentiating this latter equation with respect to y, 1 we obtain WxdW1 x x x. C (4) W x dW dx dW 1ey yy e, ddxy d x In particular, the area of the region bounded by the curve W x , the x-axis, and the line x e is, there- so fore,
1 y e W x e yy 1 yyy1e 1 e Wdxxx W x 1 (3) Wx 0 W x y W x e 0 ,0x . yx11WW1xx x 1 ee111 limW 1 1. 11 0 W In particular, We , and similarly, ee11 2 We note this result agrees with evaluating the integral lim Wx . What about W0 the right-hand via inverse functions [11], because then xe1 e Wx side of (3) is indeterminant at x 0 , but division of both Wdxxe W e 0W0 x ed1x xe . sides of (1) by x and taking the limit as x 0 give 00 Wx lim 1 . This yields Other integrals, involving functions containing W, can x0 x be computed, some just with a special change of variable WWxxx1 [6]. For instance, W0 lim lim . 111 xx00xx1W 1W x 1 2Wx 2 x Wdxx e Wx W x C. 222 For large x, the graph of W x bears strong resem- The function xW x is concave up, connecting 0,0 W x e blance to ln x , since from (2) we have lim 1 , 2 x ln x and ee, , hence its area xxxeWd 318 0 although we have to be careful here because the difference e Wlnx x increases without bound as x [7]. is less than xxd e2 2. Similarly we find The graph of W x , like that of ln x , is concave down- 0 x ward for all x since xe is concave upward. If we dif- e x 1 e ferentiate (3), and omit the argument x for brevity, then de12W3x 2Wx xe2 4, and this is 0 0 W4x 23 xx1WWW W1W 2W W 2 W 0. greater than e 2 since x W x is increasing and 2223 xx1W1W concave down from 0,1 to ee, .
Copyright © 2013 SciRes. AM 890 T. P. DENCE
5. Applications Since the right-hand side of this last equation is of the form zez , and since we know y zez iff zy W , An article appeared in the February, 2000, issue of FO- 11 CUS, the newsletter of the Mathematical Association of then x ln 2 W ln 2 10 , or x Wln2 . America, touting the merits of the W function as a can- ln 2 10 didate for a new elementary function to be studied in Using Kalman’s glog function we can solve 210x x schools and to be included in textbooks [12]. The ration- 110 and get xg log . Since ale for this was that not only is W a radically different log 2 log 2 function from the traditional elementary functions of poly- 11 nomials, rationals, exponentials, logarithmics, and trigo- ln 2 0.069 we can use (1) to approximate nometrics, but its calculus provides a wealth of interest- 10 e ing, and powerful, applications. A number of these are 1 Wln2 and get −0.0746900848, so mentioned in a paper by Corless et al., where they de- 10 scribe such applications as enumeration of trees, com- x = 0.1077550149. Checking, we find 2x = 1.07755015 = bustion, enzyme kinetics, linear delay equations, popula- 10x. tion growth, spread of disease, and the analysis of algo- The equation 210x x is a special case of a more rithms [3]. An article [13] by Packel and Yuen shows general setting adxebx c , where we assume the base that W is instrumental in determining the maximum a 0 and where neither b nor d equals zero. The sub- range for a projectile with linear resistance (problems of be this type have certainly been important for several thou- stitution tbx then g ives d sand years). The solution for the current in a series di- be ode/resistor circuit can also be written in terms of W. t Applications of W are found in complex cases involving bx c t be d c d td be td aaad e e , atomic, nuclear, and optical physics. The first physics bbbb problem to be solved explicitly in terms of W was one in which the exchange forces between two nuclei within the and, thus, hydrogen molecular ion H2 were calculated [14]. be be be ccctd b b Several other cases involve generalized Gaussian noise, aattddda a a tatte.tln a solar winds, black holes, general relativity, quantum chro- btd d modynamics, fuel consumption, Stirling’s formula for n!, Multiplication of both sides by ln a gives be cardiorespiratory control, water-wave heights in ocean- b c lnaa d t ln a etaln , which now has the form ography, enumeration of trees in combinatorics, and sta- d tistical mechanics [5,15-17]. A really interesting analog be b c of W x is given by Dan Kalman [18], where he de- w d uw e , so wu W , or taln W ln aa fines a function glog, similar to W, in that glog is the d ex and, hence, inverse to . The glog function bears a strong resem- be x be 1 b c bx t Wln a a d , blance to W, possessing similar properties and useful dadln common applications, such as solving exponential-linear be equations. The two functions are intimately related by c 1 bed Wlog1x gx and g logxx W 1 . that is, xWaa ln . baln d d In the remainder of this article I wish to focus on a cou- Another interesting algebraic application involves the ple of applications dealing with ordinary algebraic equa- x tion solving. infinite tower of exponents xx , which will be denoted by T x . To solve the particular equation T2 x 6. Algebra one might argue that this is equ ivalent to xTx 2 , in which case we have x2 2 , so x 2 , which is the In a high-school precalculus course one might be pre- correct solution to T2. x But what about T(x) = 3, sented with the elementary equation 210x to solve. T(x) = 4, or T(x) = y. It stands to reas o n that as y in- Now, instead, let’s solve a similar equation 210x x , creases, so does x. But with T4x , we can write this which means that it won’t suffice to begin by taking the T x 4 as x 4 , or x 4 , so x 2 again! Something logarithm of both sides. Instead, we proceed as follows: isn’t right. ln 2 The probl em lie s wi t h the do main of T. We find in [19] 210110210ex xxxxx ln 2 x In2exIn2 10 that the infinite tower of expone nts is only defined (i.e.,
Copyright © 2013 SciRes. AM T. P. DENCE 891
1 its interval of convergence) for x e e , or ap- ee proximately 0.065988x 1.444667 . So if x is selected from this interval, what is T x ? If we set T x y then xTx yxln e yxln yln x W ln x Wl nx . yxln y. ln x Note also that y 1 when x 1, and the above ex- pression for y gives a function continuous at x 1,
1 e since lim Wuu 1 . Hence, if e x e , then u0 e 1 1 exln , so y e , and this is why the equa- e e tion T2 x is solvable, but T4 x is not. The graph of T is therefore an increasing function with
1 e 1 domain ,e and range ,e . It also passes x e Figure 3. Graph of y x . e e through the two obvious points of 1 y y2 11 yy ln x or y ; so again ,W 1 ,0 .567143 and 1,1 . What else can ee yx x xy ln x we deduce? Checking for differentiability, we have from y11 . Use of this form for easier access to y then (3), gives, after some alge braic manipulations and cancella- tions, Tx yyxyyyxyx322ln 1ln1ln Wln x 11 y . lnx W ln x xy2 1l nx3 lnxx 1 W ln x x ln 2 x This complex expression appears to yield negative
WlnWlnxx values for all x 0.394 and positive values for all 2 x 0.394 , and y 0.394 0 . Hence, we have an in- xxln 1W lnx flection point at xy 0.394, 0.5817 . Also 2 Wln x 1 0.58172 , y0.394 0.557 . Put- ln x xxx1lnT 0.394 1 0.93140.5817 and since the limit of this expression is 1 as x 1, then ting all of these pieces of the puzzle together, w e obtain a T1 1, and hence T is never 0, so T is al ways decent graph of T, as shown in Figure 3. The tower function T must necessarily possess an in- strictly increasing. The following small table (Table 1) 1 of values will prove helpful. verse T . We note then that Alternatively, we coul d have found T by implicit Tx yxTx yxyy xy1 y differentiation of yxx T x xy . Thus and, conse quently, this inverse is T11x x x . Compo- sition of the two functions give the interesting pair of Table 1. Some derivative values. identities,
x Tx 1 x 1 x x 11x e1 e xe xxxexxx,,e. e e e 1 1 1 e 0.558
e e e REFERENCES 1e 2 1.025 2e [1] J. J. Gray and L. Tiling, “Johann Heinrich Lambert, 0.394 0.557 Mathematician and Scientist,” Historia Mathematica, Vol.
Copyright © 2013 SciRes. AM 892 T. P. DENCE
5, No. 7, 1978, pp. 13-14. [11] F. D. Parker, “Integrals of Inverse Functions,” The Ame- doi:10.1016/0315-0860(78)90133-7 rican Mathematical Monthly, Vol. 62, 1955, pp. 439-440. [2] B. Hays, “Why W,” American Scientist, Vol. 93, No. 2, doi:10.2307/2307006 2005, pp. 104-108. [12] F. Gouvea, Ed., “Time for a New Elementary Function?” [3] R. M. Corless, G. H. Gonnet, D. E. Hare, D. J. Jeffrey and FOCUS (Newsletter of Mathematics Association of Ame- D. E. Knuth, “On the Lambert W Function,” Advances in rica), Vol. 20, 2000, p. 2. Computational Mathematics, Vol. 5, No. 1, 1996, pp. [13] E. W. Packel and D. S. Yuen, “Projectile Motion with 329-359. Resistance and the Lambert W Function,” The College [4] L. Euler, “De Formulis Exponentialibus Replicates,” Le- Mathematics Journal, Vol. 35, No. 5, 2004, pp. 337-350. onhardi Euleri Opera Omnia, Ser. 1, Opera Mathematics, doi:10.2307/4146843 Vol. 15, 1927, pp. 268-297. [14] S. R. Valluri, D. J. Jeffrey and R. H. Corless, “Some Ap- [5] F. Chaspeau-Blondeau and A. Monir, “Numerical Evalua- plications of the Lambert W Function to Physics,” Cana- tion of the Lambert W Function and Application to Gen- dian Journal of Physics, Vol. 78, No. 9, 2000, pp. 823- eration of Generalized Gaussian Noise with Exponent ½,” 831. IEEE Transactions on Signal Processing, Vol. 50, No. 1, [15] J. M. Borwein and R. M. Corless, “Emerging Tools for 2002, pp. 2160-2165. doi:10.1109/TSP.2002.801912 Experimental Mathematics,” The American Mathematical [6] R. M. Corless, G. H. Gonnet, D. E. Hare and D. J. Jeffrey, Monthly, Vol. 106, No. 10, 1999, pp. 889-909. “Lambert’s W Function in Maple,” The Maple Technical doi:10.2307/2589743 Newsletter, Vol. 9, 1993, pp. 12-22. [16] S. R. Cranmer, “New Views of the Solar Wind with the [7] F. Olver, D. Lozier, et al., “NIST Handbook of Mathe- Lambert W Function,” American Journal of Physics, Vol. matical Functions,” Cambridge University Press, Cam- 72, No. 11, 2004, pp. 1397-1403. doi:10.1119/1.1775242 bridge, 2010. [17] D. P. Francis, K. Willson, L. C. Davies, A. J. Coats and [8] W. Ledermann, “Handbook of Applicable Mathematics,” M. Piepoli, “Quantitative General Theory for Periodic Vol. III, John Wiley & Sons, New York, 1981. pp. 151- Breathing in Chronic Heart Failure and Its Clinical Impli- 152. cations,” Circulation, Vol. 102, No. 18, 2000, pp. 2214- 2221. doi:10.1161/01.CIR.102.18.2214 [9] G. Alefeld, “On the Convergence of Halley’s Method,” The American Mathematical Monthly, Vol. 88, No. 7, [18] D. Kalman, “A Generalized Logarithm for Exponential- 1981, pp. 530-536. doi:10.2307/2321760 Linear Equations,” The College Mathematics Journal, Vol. 32, No. 1, 2001, pp. 2-14. doi:10.2307/2687213 [10] F. N. Fritsch, R. E. Shafer and W. P. Crowly, “Solution to the Transcendental Equation wew = x,” Communications [19] R. Arthur Knoebel, “Exponentials Reiterated,” The Ame- of the ACM, Vol. 16, No. 2, 1973, pp. 123-124. rican Mathematical Monthly, Vol. 88, No. 4, 1981, pp. doi:10.1145/361952.361970 235-252. doi:10.2307/2320546
Copyright © 2013 SciRes. AM