Lambert W function
In mathematics, the Lambert W function, also called the omega function or product logarithm, is a set of functions, namely the branches of the inverse relation of the function f(w) = we^{w}, where w is any complex number and e^{w} is the exponential function.
For each integer k there is one branch, denoted by W_{k}(z), which is a complexvalued function of one complex argument. W_{0} is known as the principal branch. These functions have the following property: if z and w are any complex numbers, then
holds if and only if
When dealing with real numbers only, the two branches W_{0} and W_{1} suffice: for real numbers x and y the equation
can be solved for y only if x ≥ −1/e; we get y=W_{0}(x) if x ≥ 0 and the two values y=W_{0}(x) and y=W_{1}(x) if −1/e ≤ x < 0.
The Lambert W relation cannot be expressed in terms of elementary functions.[1] It is useful in combinatorics, for instance, in the enumeration of trees. It can be used to solve various equations involving exponentials (e.g. the maxima of the Planck, Bose–Einstein, and Fermi–Dirac distributions) and also occurs in the solution of delay differential equations, such as y′(t) = a y(t − 1). In biochemistry, and in particular enzyme kinetics, a closedform solution for the timecourse kinetics analysis of Michaelis–Menten kinetics is described in terms of the Lambert W function.
Terminology
The Lambert W function is named after Johann Heinrich Lambert. The principal branch W_{0} is denoted Wp in the Digital Library of Mathematical Functions, and the branch W_{−1} is denoted Wm there.
The notation convention chosen here (with W_{0} and W_{−1}) follows the canonical reference on the Lambert W function by Corless, Gonnet, Hare, Jeffrey and Knuth.[2]
History
Lambert first considered the related Lambert's Transcendental Equation in 1758,[3] which led to an article by Leonhard Euler in 1783[4] that discussed the special case of we^{w}.
The function Lambert considered was
Euler transformed this equation into the form
Both authors derived a series solution for their equations.
Once Euler had solved this equation he considered the case a = b. Taking limits he derived the equation
He then put a = 1 and obtained a convergent series solution for the resulting equation, expressing x in terms of c.
After taking derivatives with respect to x and some manipulation, the standard form of the Lambert function is obtained.
In 1993, when it was reported that the Lambert W function provides an exact solution to the quantummechanical doublewell Dirac delta function model for equal charges—a fundamental problem in physics—Corless and developers of the Maple computer algebra system made a library search and found that this function was ubiquitous in nature.[2][5]
Another example where this function is found is in Michaelis–Menten kinetics.
Elementary properties, branches and range
There are countably many branches of the W function, denoted by W_{k}(z), for integer k; W_{0}(z) being the main (or principal) branch. W_{0}(z) is defined for all complex numbers z while W_{k}(z) with k ≠ 0 is defined for all nonzero z. We have W_{0}(0)=0 and lim_{z→0}W_{k}(z)=−∞ for all k ≠ 0.
The branch point for the principal branch is at z = −1/e, with a branch cut that extends to −∞ along the negative real axis. This branch cut separates the principal branch from the two branches W_{−1} and W_{1}. In all branches W_{k} with k ≠ 0, there is a branch point at z = 0 and a branch cut along the entire negative real axis.
The functions W_{k}(z), k∈Z are all injective and their ranges are disjoint. The range of the entire multivalued function W is the complex plane. The image of the real axis is the union of the real axis and the quadratrix of Hippias, the parametric curve w = −t cot t + it.
Calculus
Derivative
By implicit differentiation, one can show that all branches of W satisfy the differential equation
(W is not differentiable for z = −1/e.) As a consequence, we get the following formula for the derivative of W:
Using the identity e^{W(z)} = z / W(z), we get the following equivalent formula:
At the origin we have
Antiderivative
The function W(x), and many expressions involving W(x), can be integrated using the substitution w = W(x), i.e. x = we^{w}:
(The last equation is more common in the literature but does not hold at x = 0). One consequence of this (using the fact that W_{0}(e) = 1) is the identity
Asymptotic expansions
The Taylor series of W_{0} around 0 can be found using the Lagrange inversion theorem and is given by
The radius of convergence is 1/e, as may be seen by the ratio test. The function defined by this series can be extended to a holomorphic function defined on all complex numbers with a branch cut along the interval (−∞, −1/e]; this holomorphic function defines the principal branch of the Lambert W function.
For large values of x, W_{0} is asymptotic to
where L_{1} = ln x, L_{2} = ln ln x, and [^{l + m}
_{l + 1}] is a nonnegative Stirling number of the first kind.[2] Keeping only the first two terms of the expansion,
The other real branch, W_{−1}, defined in the interval [−1/e, 0), has an approximation of the same form as x approaches zero, with in this case L_{1} = ln(−x) and L_{2} = ln(−ln(−x)).[2]
It is shown[6] that the following bound holds (the upper bound only for x ≥ e):
In 2013 it was proven[7] that the branch W_{−1} can be bounded as follows:
Integer and complex powers
Integer powers of W_{0} also admit simple Taylor (or Laurent) series expansions at zero:
More generally, for r ∈ ℤ, the Lagrange inversion formula gives
which is, in general, a Laurent series of order r. Equivalently, the latter can be written in the form of a Taylor expansion of powers of W_{0}(x) / x:
which holds for any r ∈ ℂ and x < 1/e.
Identities
A few identities follow from the definition:
Note that, since f(x) = xe^{x} is not injective, it does not always hold that W(f(x)) = x, much like with the inverse trigonometric functions. For fixed x < 0 and x ≠ −1, the equation xe^{x} = ye^{y} has two solutions in y, one of which is of course y = x. Then, for i = 0 and x < −1, as well as for i = −1 and x ∈ (−1, 0), y = W_{i}(xe^{x}) is the other solution.
Some other identities:[8]
 (which can be extended to other n and x if the correct branch is chosen).
From inverting f(ln x):
Substituting −ln x in the definition:
With Euler's iterated exponential h(x):
Special values
For any nonzero algebraic number x, W(x) is a transcendental number. Indeed, if W(x) is zero, then x must be zero as well, and if W(x) is nonzero and algebraic, then by the Lindemann–Weierstrass theorem, e^{W(x)} must be transcendental, implying that x = W(x)e^{W(x)} must also be transcendental.
The following are special values of the principal branch:
 (the Omega constant).
Representations
The principal branch of the Lambert function can be represented by a proper integral, due to Poisson:[10]
On the wider domain −1/e ≤ x ≤ e, the considerably simpler representation is found by Mező:[11]
The following continued fraction representation also holds for the principal branch:[12]
Also, if W(z) < 1:[13]
In turn, if W(z) > e, then
Other formulas
Definite integrals
There are several useful definite integral formulas involving the principal branch of the W function, including the following:
The first identity can be found by writing the Gaussian integral in polar coordinates.
The second identity can be derived by making the substitution u = W(x), which gives
Thus
The third identity may be derived from the second by making the substitution u = x^{−2} and the first can also be derived from the third by the substitution z = (tan x) / √2.
Except for z along the branch cut (−∞, −1/e] (where the integral does not converge), the principal branch of the Lambert W function can be computed by the following integral:[14]
where the two integral expressions are equivalent due to the symmetry of the integrand.
Indefinite integrals
Applications
Solving equations
The Lambert W function is used to solve equations in which the unknown quantity occurs both in the base and in the exponent, or both inside and outside of a logarithm. The strategy is to convert such an equation into one of the form and then to solve for . using the W function.
For example, the equation
(where is an unknown real number) can be solved by rewriting it as
This last equation has the desired form, and since all involved numbers are real, we can say
and thus
Viscous flows
Granular and debris flow fronts and deposits, and the fronts of viscous fluids in natural events and in laboratory experiments can be described by using the Lambert–Euler omega function as follows:
where H(x) is the debris flow height, x is the channel downstream position, L is the unified model parameter consisting of several physical and geometrical parameters of the flow, flow height and the hydraulic pressure gradient.
In pipe flow, the Lambert W function is part of the explicit formulation of the Colebrook equation for finding the Darcy friction factor. This factor is used to determine the pressure drop through a straight run of pipe when the flow is turbulent.[15]
Neuroimaging
The Lambert W function was employed in the field of neuroimaging for linking cerebral blood flow and oxygen consumption changes within a brain voxel, to the corresponding blood oxygenation level dependent (BOLD) signal.[16]
Chemical engineering
The Lambert W function was employed in the field of chemical engineering for modelling the porous electrode film thickness in a glassy carbon based supercapacitor for electrochemical energy storage. The Lambert W function turned out to be the exact solution for a gas phase thermal activation process where growth of carbon film and combustion of the same film compete with each other.[17][18]
Materials science
The Lambert W function was employed in the field of epitaxial film growth for the determination of the critical dislocation onset film thickness. This is the calculated thickness of an epitaxial film, where due to thermodynamic principles the film will develop crystallographic dislocations in order to minimise the elastic energy stored in the films. Prior to application of Lambert W for this problem, the critical thickness had to be determined via solving an implicit equation. Lambert W turns it in an explicit equation for analytical handling with ease.[19]
Porous media
The Lambert W function has been employed in the field of fluid flow in porous media to model the tilt of an interface separating two gravitationally segregated fluids in a homogeneous tilted porous bed of constant dip and thickness where the heavier fluid, injected at the bottom end, displaces the lighter fluid that is produced at the same rate from the top end. The principal branch of the solution corresponds to stable displacements while the −1 branch applies if the displacement is unstable with the heavier fluid running underneath the lighter fluid.[20]
Bernoulli numbers and Todd genus
The equation (linked with the generating functions of Bernoulli numbers and Todd genus):
can be solved by means of the two real branches W_{0} and W_{−1}:
This application shows that the branch difference of the W function can be employed in order to solve other transcendental equations.[21]
Statistics
The centroid of a set of histograms defined with respect to the symmetrized Kullback–Leibler divergence (also called the Jeffreys divergence) has a closed form using the Lambert W function.[22]
Exact solutions of the Schrödinger equation
The Lambert W function appears in a quantummechanical potential (see Lambert W step potential) which affords the fifth – next to those of the harmonic oscillator plus centrifugal, the Coulomb plus inverse square, the Morse, and the inverse square root potential – exact solution to the stationary onedimensional Schrödinger equation in terms of the confluent hypergeometric functions. The potential is given as
A peculiarity of the solution is that each of the two fundamental solutions that compose the general solution of the Schrödinger equation is given by a combination of two confluent hypergeometric functions of an argument proportional to[23]
Exact solutions of the Einstein vacuum equations
In the Schwarzschild metric solution of the Einstein vacuum equations, the W function is needed to go from the EddingtonFinkelstein coordinates to the Schwarzschild coordinates. For this reason, it also appears in the construction of the Kruskal–Szekeres coordinates.
Resonances of the deltashell potential
The swave resonances of the deltashell potential can be written exactly in terms of the Lambert W function.[24]
Thermodynamic equilibrium
If a reaction involves reactants and products having heat capacities that are constant with temperature then the equilibrium constant K obeys
for some constants a, b, and c. When c (equal to ΔC_{p} / R) is not zero we can find the value or values of T where K equals a given value as follows, where we use L for ln T.
If a and c have the same sign there will be either two solutions or none (or one if the argument of W is exactly −1/e). (The upper solution may not be relevant.) If they have opposite signs, there will be one solution.
Generalizations
The standard Lambert W function expresses exact solutions to transcendental algebraic equations (in x) of the form:

(1)
where a_{0}, c and r are real constants. The solution is
Generalizations of the Lambert W function[27][28][29] include:
 An application to general relativity and quantum mechanics (quantum gravity) in lower dimensions, in fact a link (unknown prior to 2007[30]) between these two areas, where the righthand side of (1) is replaced by a quadratic polynomial in x:

(2)

 where r_{1} and r_{2} are real distinct constants, the roots of the quadratic polynomial. Here, the solution is a function has a single argument x but the terms like r_{i} and a_{0} are parameters of that function. In this respect, the generalization resembles the hypergeometric function and the Meijer G function but it belongs to a different class of functions. When r_{1} = r_{2}, both sides of (2) can be factored and reduced to (1) and thus the solution reduces to that of the standard W function. Equation (2) expresses the equation governing the dilaton field, from which is derived the metric of the R = T or lineal twobody gravity problem in 1 + 1 dimensions (one spatial dimension and one time dimension) for the case of unequal rest masses, as well as the eigenenergies of the quantummechanical doublewell Dirac delta function model for unequal charges in one dimension.
 Analytical solutions of the eigenenergies of a special case of the quantum mechanical threebody problem, namely the (threedimensional) hydrogen moleculeion.[31] Here the righthand side of (1) is replaced by a ratio of infinite order polynomials in x:

(3)

 where r_{i} and s_{i} are distinct real constants and x is a function of the eigenenergy and the internuclear distance R. Equation (3) with its specialized cases expressed in (1) and (2) is related to a large class of delay differential equations. G. H. Hardy's notion of a "false derivative" provides exact multiple roots to special cases of (3).[32]
Applications of the Lambert W function in fundamental physical problems are not exhausted even for the standard case expressed in (1) as seen recently in the area of atomic, molecular, and optical physics.[33]
Plots
Numerical evaluation
The W function may be approximated using Newton's method, with successive approximations to w = W(z) (so z = we^{w}) being
The W function may also be approximated using Halley's method,
given in Corless et al.[2] to compute W.
Software
The Lambert W function is implemented as LambertW in Maple, lambertw in GP (and glambertW in PARI), lambertw in Matlab,[34] also lambertw in octave with the specfun package, as lambert_w in Maxima,[35] as ProductLog (with a silent alias LambertW) in Mathematica,[36] as lambertw in Python scipy's special function package,[37] as LambertW in Perl's ntheory module,[38] and as gsl_sf_lambert_W0, gsl_sf_lambert_Wm1 functions in the special functions section of the GNU Scientific Library (GSL). In the Boost C++ libraries, the calls are lambert_w0, lambert_wm1, lambert_w0_prime, and lambert_wm1_prime. In R, the Lambert W function is implemented as the lambertW0 and lambertWm1 functions in the lamW package.[39]
A C++ code for all the branches of the complex Lambert W function is available on the homepage of István Mező.[40]
See also
Notes
 Chow, Timothy Y. (1999), "What is a closedform number?", American Mathematical Monthly, 106 (5): 440–448, arXiv:math/9805045, doi:10.2307/2589148, JSTOR 2589148, MR 1699262.
 Corless, R. M.; Gonnet, G. H.; Hare, D. E. G.; Jeffrey, D. J.; Knuth, D. E. (1996). "On the Lambert W function" (PostScript). Advances in Computational Mathematics. 5: 329–359. arXiv:1809.07369. doi:10.1007/BF02124750.
 Lambert J. H., "Observationes variae in mathesin puram", Acta Helveticae physicomathematicoanatomicobotanicomedica, Band III, 128–168, 1758.
 Euler, L. "De serie Lambertina Plurimisque eius insignibus proprietatibus". Acta Acad. Scient. Petropol. 2, 29–51, 1783. Reprinted in Euler, L. Opera Omnia, Series Prima, Vol. 6: Commentationes Algebraicae. Leipzig, Germany: Teubner, pp. 350–369, 1921.
 Corless, R. M.; Gonnet, G. H.; Hare, D. E. G.; Jeffrey, D. J. (1993). "Lambert's W function in Maple". The Maple Technical Newsletter. 9: 12–22. CiteSeerX 10.1.1.33.2556.
 A. Hoorfar, M. Hassani, Inequalities on the Lambert W Function and Hyperpower Function, JIPAM, volume 9, issue 2, article 51. 2008.
 Chatzigeorgiou, I. (2013). "Bounds on the Lambert function and their Application to the Outage Analysis of User Cooperation". IEEE Communications Letters. 17 (8): 1505–1508. arXiv:1601.04895. doi:10.1109/LCOMM.2013.070113.130972.
 "Lambert function: Identities (formula 01.31.17.0001)".
 "Lambert WFunction".
 Finch, S. R. (2003). Mathematical constants. Cambridge University Press. p. 450.
 István, Mező. "An integral representation for the principal branch of Lambert the W function". Retrieved 7 November 2017.
 Dubinov, A. E.; Dubinova, I. D.; Saǐkov, S. K. (2006). The Lambert W Function and Its Applications to Mathematical Problems of Physics (in Russian). RFNCVNIIEF. p. 53.
 Robert M., Corless; David J., Jeffrey; Donald E., Knuth (1997). A sequence of series for the Lambert W function. Proceedings of the 1997 International Symposium on Symbolic and Algebraic Computation. pp. 197–204. doi:10.1145/258726.258783. ISBN 9780897918756.
 "The Lambert W Function". Ontario Research Centre for Computer Algebra.
 More, A. A. (2006). "Analytical solutions for the Colebrook and White equation and for pressure drop in ideal gas flow in pipes". Chemical Engineering Science. 61 (16): 5515–5519. doi:10.1016/j.ces.2006.04.003.
 Sotero, Roberto C.; IturriaMedina, Yasser (2011). "From Blood oxygenation level dependent (BOLD) signals to brain temperature maps". Bull Math Biol (Submitted manuscript). 73 (11): 2731–47. doi:10.1007/s1153801196455. PMID 21409512.
 Braun, Artur; Wokaun, Alexander; Hermanns, HeinzGuenter (2003). "Analytical Solution to a Growth Problem with Two Moving Boundaries". Appl Math Model. 27 (1): 47–52. doi:10.1016/S0307904X(02)000859.
 Braun, Artur; Baertsch, Martin; Schnyder, Bernhard; Koetz, Ruediger (2000). "A Model for the film growth in samples with two moving boundaries – An Application and Extension of the UnreactedCore Model". Chem Eng Sci. 55 (22): 5273–5282. doi:10.1016/S00092509(00)001433.
 Braun, Artur; Briggs, Keith M.; Boeni, Peter (2003). "Analytical solution to Matthews' and Blakeslee's critical dislocation formation thickness of epitaxially grown thin films". J Cryst Growth. 241 (1–2): 231–234. Bibcode:2002JCrGr.241..231B. doi:10.1016/S00220248(02)009417.
 Colla, Pietro (2014). "A New Analytical Method for the Motion of a TwoPhase Interface in a Tilted Porous Medium". PROCEEDINGS,ThirtyEighth Workshop on Geothermal Reservoir Engineering,Stanford University. SGPTR202.()
 D. J. Jeffrey and J. E. Jankowski, "Branch differences and Lambert W"
 F. Nielsen, "Jeffreys Centroids: A ClosedForm Expression for Positive Histograms and a Guaranteed Tight Approximation for Frequency Histograms"
 A.M. Ishkhanyan, "The Lambert W barrier – an exactly solvable confluent hypergeometric potential".
 de la Madrid, R. (2017). "Numerical calculation of the decay widths, the decay constants, and the decay energy spectra of the resonances of the deltashell potential". Nucl. Phys. A. 962: 24–45. arXiv:1704.00047. Bibcode:2017NuPhA.962...24D. doi:10.1016/j.nuclphysa.2017.03.006.
 Floratos, Emmanuel; Georgiou, George; Linardopoulos, Georgios (2014). "LargeSpin Expansions of GKP Strings". JHEP. 03 (3): 0180. arXiv:1311.5800. doi:10.1007/JHEP03(2014)018.
 Floratos, Emmanuel; Linardopoulos, Georgios (2015). "LargeSpin and LargeWinding Expansions of Giant Magnons and Single Spikes". Nucl. Phys. B. 897: 229–275. arXiv:1406.0796. doi:10.1016/j.nuclphysb.2015.05.021.
 Scott, T. C.; Mann, R. B.; Martinez Ii, Roberto E. (2006). "General Relativity and Quantum Mechanics: Towards a Generalization of the Lambert W Function". AAECC (Applicable Algebra in Engineering, Communication and Computing). 17 (1): 41–47. arXiv:mathph/0607011. doi:10.1007/s0020000601961.
 Scott, T. C.; Fee, G.; Grotendorst, J. (2013). "Asymptotic series of Generalized Lambert W Function". SIGSAM (ACM Special Interest Group in Symbolic and Algebraic Manipulation). 47 (185): 75–83. doi:10.1145/2576802.2576804.
 Scott, T. C.; Fee, G.; Grotendorst, J.; Zhang, W.Z. (2014). "Numerics of the Generalized Lambert W Function". SIGSAM. 48 (1/2): 42–56. doi:10.1145/2644288.2644298.
 Farrugia, P. S.; Mann, R. B.; Scott, T. C. (2007). "Nbody Gravity and the Schrödinger Equation". Class. Quantum Grav. 24 (18): 4647–4659. arXiv:grqc/0611144. Bibcode:2007CQGra..24.4647F. doi:10.1088/02649381/24/18/006.
 Scott, T. C.; AubertFrécon, M.; Grotendorst, J. (2006). "New Approach for the Electronic Energies of the Hydrogen Molecular Ion". Chem. Phys. 324 (2–3): 323–338. arXiv:physics/0607081. Bibcode:2006CP....324..323S. CiteSeerX 10.1.1.261.9067. doi:10.1016/j.chemphys.2005.10.031.
 Maignan, Aude; Scott, T. C. (2016). "Fleshing out the Generalized Lambert W Function". SIGSAM. 50 (2): 45–60. doi:10.1145/2992274.2992275.
 Scott, T. C.; Lüchow, A.; Bressanini, D.; Morgan, J. D. III (2007). "The Nodal Surfaces of Helium Atom Eigenfunctions" (PDF). Phys. Rev. A. 75 (6): 060101. Bibcode:2007PhRvA..75f0101S. doi:10.1103/PhysRevA.75.060101.
 lambertw – MATLAB
 Maxima, a Computer Algebra System
 ProductLog at WolframAlpha
 "Scipy.special.lambertw — SciPy v0.16.1 Reference Guide".
 ntheory at MetaCPAN
 Adler, Avraham (20170424), lamW: Lambert W Function, retrieved 20171219
 The webpage of István Mező
References
 Corless, R.; Gonnet, G.; Hare, D.; Jeffrey, D.; Knuth, Donald (1996). "On the Lambert W function" (PDF). Advances in Computational Mathematics. 5: 329–359. doi:10.1007/BF02124750. ISSN 10197168
 ChapeauBlondeau, F.; Monir, A. (2002). "Evaluation of the Lambert W Function and Application to Generation of Generalized Gaussian Noise With Exponent 1/2" (PDF). IEEE Trans. Signal Process. 50 (9).
 Francis; et al. (2000). "Quantitative General Theory for Periodic Breathing". Circulation. 102 (18): 2214–21. CiteSeerX 10.1.1.505.7194. doi:10.1161/01.cir.102.18.2214. PMID 11056095. (Lambert function is used to solve delaydifferential dynamics in human disease.)
 Hayes, B. (2005). "Why W?" (PDF). American Scientist. 93 (2): 104–108. doi:10.1511/2005.2.104.
 Roy, R.; Olver, F. W. J. (2010), "Lambert W function", in Olver, Frank W. J.; Lozier, Daniel M.; Boisvert, Ronald F.; Clark, Charles W. (eds.), NIST Handbook of Mathematical Functions, Cambridge University Press, ISBN 9780521192255, MR 2723248
 Stewart, Seán M. (2005). "A New Elementary Function for Our Curricula?" (PDF). Australian Senior Mathematics Journal. 19 (2): 8–26. ISSN 08194564. ERIC EJ720055. Lay summary.
 Veberic, D., "Having Fun with Lambert W(x) Function" arXiv:1003.1628 (2010); Veberic, D. (2012). "Lambert W function for applications in physics". Computer Physics Communications. 183 (12): 2622–2628. arXiv:1209.0735. Bibcode:2012CoPhC.183.2622V. doi:10.1016/j.cpc.2012.07.008.
 Chatzigeorgiou, I. (2013). "Bounds on the Lambert function and their Application to the Outage Analysis of User Cooperation". IEEE Communications Letters. 17 (8): 1505–1508. arXiv:1601.04895. doi:10.1109/LCOMM.2013.070113.130972.
External links
Wikimedia Commons has media related to Lambert W function. 
 National Institute of Science and Technology Digital Library – Lambert W
 MathWorld – Lambert WFunction
 Computing the Lambert W function
 Corless et al. Notes about Lambert W research
 GPL C++ implementation with Halley's and Fritsch's iteration.
 Special Functions of the GNU Scientific Library – GSL