Lambert W function

From HandWiki
Short description: Multivalued function in mathematics


The product logarithm Lambert W function plotted in the complex plane from −2 − 2i to 2 + 2i
The product logarithm Lambert W function plotted in the complex plane from −2 − 2i to 2 + 2i
The graph of y=W(x) for real x<6 and y>4. The upper branch (blue) with y1 is the graph of the function W0 (principal branch), the lower branch (magenta) with y1 is the graph of the function W1. The minimum value of x is at {1/e,1}.

In mathematics, the Lambert W function, also called the omega function or product logarithm,[1] is a multivalued function, namely the branches of the converse relation of the function f(w)=wew, where w is any complex number and ew is the exponential function. The function is named after Johann Lambert, who considered a related problem in 1758. Building on Lambert's work, Leonhard Euler described the W function per se in 1783.[2]

For each integer k there is one branch, denoted by Wk(z), which is a complex-valued function of one complex argument. W0 is known as the principal branch. These functions have the following property: if z and w are any complex numbers, then

wew=z

holds if and only if

w=Wk(z)   for some integer k.

When dealing with real numbers only, the two branches W0 and W1 suffice: for real numbers x and y the equation

yey=x

can be solved for y only if x1e; yields y=W0(x) if x0 and the two values y=W0(x) and y=W1(x) if 1ex<0.

The Lambert W function's branches cannot be expressed in terms of elementary functions.[3] 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(t1). In biochemistry, and in particular enzyme kinetics, an opened-form solution for the time-course kinetics analysis of Michaelis–Menten kinetics is described in terms of the Lambert W function.

Main branch of the Lambert W function in the complex plane, plotted with domain coloring. Note the branch cut along the negative real axis, ending at 1e.
The modulus of the principal branch of the Lambert W function, colored according to argW(z)

Terminology

The notation convention chosen here (with W0 and W1) follows the canonical reference on the Lambert W function by Corless, Gonnet, Hare, Jeffrey and Knuth.[4]

The name "product logarithm" can be understood as follows: since the inverse function of f(w)=ew is termed the logarithm, it makes sense to call the inverse "function" of the product wew the "product logarithm". (Technical note: like the complex logarithm, it is multivalued and thus W is described as a converse relation rather than inverse function.) It is related to the omega constant, which is equal to W0(1).

History

Lambert first considered the related Lambert's Transcendental Equation in 1758,[5] which led to an article by Leonhard Euler in 1783[6] that discussed the special case of wew.

The equation Lambert considered was

x=xm+q.

Euler transformed this equation into the form

xaxb=(ab)cxa+b.

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

lnx=cxa.

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, it was reported that the Lambert W function provides an exact solution to the quantum-mechanical double-well Dirac delta function model for equal charges[7]—a fundamental problem in physics. Prompted by this, Rob Corless and developers of the Maple computer algebra system realized that "the Lambert W function has been widely used in many fields, but because of differing notation and the absence of a standard name, awareness of the function was not as high as it should have been."[4][8]

Another example where this function is found is in Michaelis–Menten kinetics.[9]

Although it was widely believed that the Lambert W function cannot be expressed in terms of elementary (Liouvillian) functions, the first published proof did not appear until 2008.[10]

Elementary properties, branches and range

The range of the W function, showing all branches. The black curves (including the real axis) form the image of the real axis, the orange curves are the image of the imaginary axis. The purple curve and circle are the image of a small circle around the point z = 0; the red curves are the image of a small circle around the point z = −1/e.
Plot of the imaginary part of Wn(x + iy) for branches n = −2, −1, 0, 1, 2. The plot is similar to that of the multivalued complex logarithm function except that the spacing between sheets is not constant and the connection of the principal sheet is different

There are countably many branches of the W function, denoted by Wk(z), for integer k; W0(z) being the main (or principal) branch. W0(z) is defined for all complex numbers z while Wk(z) with k ≠ 0 is defined for all non-zero z, with W0(0) = 0 and limz0Wk(z)=, for all k ≠ 0.

The branch point for the principal branch is at z=e1, 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 W1. In all branches Wk with k ≠ 0, there is a branch point at z = 0 and a branch cut along the entire negative real axis.

The functions Wk(z), kZ 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.

Inverse

Regions of the complex plane for which W(n, zez) = z, where z = x + iy. The darker boundaries of a particular region are included in the lighter region of the same color. The point at Template:Brace is included in both the n = −1 (blue) region and the n = 0 (gray) region. Horizontal grid lines are in multiples of π.

The range plot above also delineates the regions in the complex plane where the simple inverse relationship W(n,zez)=z is true. f=zez implies that there exists an n such that z=W(n,f)=W(n,zez), where n depends upon the value of z. The value of the integer n changes abruptly when zez is at the branch cut of W(n,zez), which means that zez ≤ 0, except for n=0 where it is zez ≤ −1/e.

Defining z=x+iy, where x and y are real, and expressing ez in polar coordinates, it is seen that

zez=(x+iy)ex(cosy+isiny)=ex(xcosyysiny)+iex(xsiny+ycosy)

For n0, the branch cut for W(n,zez) is the non-positive real axis, so that

xsiny+ycosy=0x=y/tan(y),

and

(xcosyysiny)ex0.

For n=0, the branch cut for W[n,zez] is the real axis with <z1/e, so that the inequality becomes

(xcosyysiny)ex1/e.

Inside the regions bounded by the above, there are no discontinuous changes in W(n,zez), and those regions specify where the W function is simply invertible, i.e. W(n,zez)=z.

Calculus

Derivative

By implicit differentiation, one can show that all branches of W satisfy the differential equation

z(1+W)dWdz=Wfor z1e.

(W is not differentiable for z = −1/e.) As a consequence, that gets the following formula for the derivative of W:

dWdz=W(z)z(1+W(z))for z∉{0,1e}.

Using the identity eW(z) = z/W(z), gives the following equivalent formula:

dWdz=1z+eW(z)for z1e.

At the origin we have

W'0(0)=1.

The n-th derivative of W is of the form:

dnWdzn=Pn(W(z))(z+eW(z))n(W(z)+1)n1for n>0,z1e.

Where Pn is a polynomial function with coefficients defined in A042977. If and only if z is a root of Pn then zez is a root of the n-th derivative of W.

Taking the derivative of the n-th derivative of W yields:

dn+1Wdzn+1=(W(z)+1)Pn(W(z))+(13nnW(z))Pn(W(z))(n+eW(z))n+1(W(z)+1)nfor n>0,z1e.

Inductively proving the n-th derivative equation.

Integral

The function W(x), and many other expressions involving W(x), can be integrated using the substitution w = W(x), i.e. x = wew:

W(x)dx=xW(x)x+eW(x)+C=x(W(x)1+1W(x))+C.

(The last equation is more common in the literature but is undefined at x = 0). One consequence of this (using the fact that W0(e) = 1) is the identity

0eW0(x)dx=e1.

Taylor series and combinatorics

Cayley's formula states that the number of tree graphs on n labeled vertices is

nn2

, so that the number of trees with a designated root vertex is

nn1

. The exponential generating function of this counting sequence is:

T(x)=n=0nn1n!xn.

The class of rooted trees has a natural recurrence: a rooted a tree is equivalent to a root vertex attached to a set of smaller rooted trees. Using the exponential formula for labeled combinatorial classes,[11] this translates into the equation:

T(x)=xeT(x),

which implies

T(x)eT(x)=x

and

W0(x)=T(x)

.

Reversing the argument, the Taylor series of

W0(x)

around

x=0

can be found directly using the Lagrange inversion theorem:

W0(x)=n=1(n)n1n!xn,

and this gives the standard analytic proof of Cayley's formula.

Asymptotic expansions

By the Lagrange inversion theorem, the Taylor series of the principal branch W0(x) around x=0 is:

W0(x)=n=1(n)n1n!xn=xx2+32x3166x4+12524x5.

The radius of convergence is 1/e by the ratio test, and the function defined by the series can be extended to a holomorphic function defined on all complex numbers except a branch cut along the interval (,1/e].

For large values x, the real function W0(x) is asymptotic to

W0(x)=L1L2+L2L1+L2(2+L2)2L12+L2(69L2+2L22)6L13+L2(12+36L222L22+3L23)12L14+=L1L2+=1m=1(1)[m+1]m!L2mL1,

where L1 = ln x, L2 = ln ln x, and [nk] is a non-negative Stirling number of the first kind.[4] Keeping only the first two terms of the expansion,

W0(x)=lnxlnlnx+(1).

The other real branch, W−1, defined in the interval [−1/e, 0), has an approximation of the same form as x approaches zero, in this case with L1 = ln(−x) and L2 = ln(−ln(−x)).[4]

Integer and complex powers

Integer powers of W0 also admit simple Taylor (or Laurent) series expansions at zero:

W0(x)2=n=22(n)n3(n2)!xn=x22x3+4x4253x5+18x6.

More generally, for rZ, the Lagrange inversion formula gives

W0(x)r=n=rr(n)nr1(nr)!xn,

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 W0(x) / x:

(W0(x)x)r=erW0(x)=n=0r(n+r)n1n!(x)n,

which holds for any rC and |x| < 1/e.

Bounds and inequalities

A number of non-asymptotic bounds are known for the Lambert function.

Principal branch

Hoorfar and Hassani[12] showed that the following bound holds for xe:

lnxlnlnx+lnlnx2lnxW0(x)lnxlnlnx+ee1lnlnxlnx.

Roberto Iacono and John P. Boyd[13] enhanced the bounds for xe as follows:

ln(xlnx)ln(xlnx)1+ln(xlnx)ln(1lnlnxlnx)W0(x)ln(xlnx)ln((1lnlnxlnx)(1ln(1lnlnxlnx)1+ln(xlnx))).

Hoorfar and Hassani[12] also showed the general bound

W0(x)ln(x+y1+ln(y)),

for every y>1/e and x1/e, with equality only for x=yln(y). The bound allows many other bounds to be derived, such as taking y=x+1 which gives the bound

W0(x)ln(2x+11+ln(x+1)).

Bounds for the function W0(xex) for x1 are obtained by Stewart.[14]

Secondary branch

The branch W−1 can be bounded as follows:[15]

12uu<W1(eu1)<12u23ufor u>0.

Identities

A plot of Wj(xex) where blue is for j = 0 and red is for j = −1. The diagonal line represents the intervals where Wj(xex) = x.
The product logarithm Lambert W function W 2(z) plotted in the complex plane from -2-2i to 2+2i
The product logarithm Lambert W function W2(z) plotted in the complex plane from −2 − 2i to 2 + 2i

A few identities follow from the definition:

W0(xex)=xfor x1,W1(xex)=xfor x1.

Since f(x) = xex 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 xex = yey has two real 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 = Wi(xex) is the other solution.

Some other identities:[16]

W(x)eW(x)=x,therefore:eW(x)=xW(x),eW(x)=W(x)x,enW(x)=(xW(x))n.
lnW0(x)=lnxW0(x)for x>0.[17]
W0(xlnx)=lnxandeW0(xlnx)=xfor 1ex.
W1(xlnx)=lnxandeW1(xlnx)=xfor 0<x1e.
W(x)=lnxW(x)for x1e,W(nxnW(x)n1)=nW(x)for n,x>0
(which can be extended to other n and x if the correct branch is chosen).
W(x)+W(y)=W(xy(1W(x)+1W(y)))for x,y>0.

Substituting −ln x in the definition:[18]

W0(lnxx)=lnxfor 0<xe,W1(lnxx)=lnxfor x>e.

With Euler's iterated exponential h(x):

h(x)=eW(lnx)=W(lnx)lnxfor x1.

c[1e,0),let t=W1(c)W0(c)1W0(c)=lnt1t,W1(c)=tlnt1t

Special values

The following are special values of the principal branch: W0(π2)=iπ2 W0(1e)=1 W0(2ln2)=ln2 W0(xlnx)=lnx(x1e0.36788) W0(xx+1lnx)=xlnx(x>0) W0(0)=0

W0(1)=Ω=(dt(ett)2+π2)110.56714329 (the omega constant)

W0(1)=eW0(1)=ln1W0(1)=lnW0(1) W0(e)=1 W0(e1+e)=e W0(e2)=12 W0(enn)=1n W0(1)0.31813+1.33723i

Special values of the branch W−1: W1(ln22)=ln4

Representations

The principal branch of the Lambert function can be represented by a proper integral, due to Poisson:[19]

π2W0(x)=0πsin(32t)xecostsin(52tsint)12xecostcos(tsint)+x2e2costsin(12t)dtfor |x|<1e.

Another representation of the principal branch was found by Kalugin–Jeffrey–Corless:[20]

W0(x)=1π0πln(1+xsinttetcott)dt.

The following continued fraction representation also holds for the principal branch:[21]

W0(x)=x1+x1+x2+5x3+17x10+133x17+1927x190+13582711x94423+.

Also, if |W0(x)| < 1:[22]

W0(x)=xexpxexpx.

In turn, if |W0(x)| > 1, then

W0(x)=lnxlnxlnx.

Other formulas

Definite integrals

There are several useful definite integral formulas involving the principal branch of the W function, including the following:

0πW0(2cot2x)sec2xdx=4π,0W0(x)xxdx=22π,0W0(1x2)dx=2π, and more generally0W0(1xN)dx=N11NΓ(11N)for N>0

where Γ denotes the gamma function.

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 = W0(x), which gives

x=ueu,dxdu=(u+1)eu.

Thus

0W0(x)xxdx=0uueuueu(u+1)eudu=0u+1ueudu=0u+1u1eudu=0u12eu2du+0u12eu2du=20(2w)12ewdw+20(2w)12ewdw(u=2w)=220w12ewdw+20w12ewdw=22Γ(32)+2Γ(12)=22(12π)+2(π)=22π.

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 = 1/2 tan x. Deriving its generalization, the fourth identity, is only slightly more involved and can be done by substituting, in turn, u=x1N, t=W0(u), and z=tN, observing that one obtains two integrals matching the definition of the gamma function, and finally using the properties of the gamma function to collect terms and simplify.

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:[23]

W0(z)=z2πππ(1νcotν)2+ν2z+νcsc(ν)eνcotνdν=zπ0π(1νcotν)2+ν2z+νcsc(ν)eνcotνdν,

where the two integral expressions are equivalent due to the symmetry of the integrand.

Indefinite integrals

W(x)xdx=W(x)22+W(x)+C

W(AeBx)dx=W(AeBx)22B+W(AeBx)B+C

W(x)x2dx=Ei(W(x))eW(x)+C

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 zez = w and then to solve for z using the W function.

For example, the equation

3x=2x+2

(where x is an unknown real number) can be solved by rewriting it as

(x+1) 3x=12(multiply by 3x/2) (x1) 3x1=16(multiply by 1/3) (ln3)(x1) e(ln3)(x1)=ln36(multiply by ln3)

This last equation has the desired form and the solutions for real x are:

(ln3)(x1)=W0(ln36)   or   (ln3)(x1)=W1(ln36)

and thus:

x=1W0(ln36)ln3=0.79011  or  x=1W1(ln36)ln3=1.44456

Generally, the solution to

x=a+becx

is:

x=a1cW(bceac)

where a, b, and c are complex constants, with b and c not equal to zero, and the W function is of any integer order.

Inviscid flows

Applying the unusual accelerating traveling-wave Ansatz in the form of ρ(η)=ρ(xat22) (where ρ, η, a, x and t are the density, the reduced variable, the acceleration, the spatial and the temporal variables) the fluid density of the corresponding Euler equation can be given with the help of the W function.[24]

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:

H(x)=1+W((H(0)1)e(H(0)1)xL),

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.[25]

Time-dependent flow in simple branch hydraulic systems

The principal branch of the Lambert W function is employed in the field of mechanical engineering, in the study of time dependent transfer of Newtonian fluids between two reservoirs with varying free surface levels, using centrifugal pumps.[26] The Lambert W function provided an exact solution to the flow rate of fluid in both the laminar and turbulent regimes: Qturb=QiζiW0[ζie(ζi+βt/b)]Qlam=QiξiW0[ξie(ξi+βt/(bΓ1))] where Qi is the initial flow rate and t is time.

Neuroimaging

The Lambert W function is 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.[27]

Chemical engineering

The Lambert W function is employed in the field of chemical engineering for modeling the porous electrode film thickness in a glassy carbon based supercapacitor for electrochemical energy storage. The Lambert W function provides an exact solution for a gas phase thermal activation process where growth of carbon film and combustion of the same film compete with each other.[28][29]

Crystal growth

In the crystal growth, the negative principal of the Lambert W-function can be used to calculate the distribution coefficient, k, and solute concentration in the melt, CL,[30][31] from the Scheil equation:

k=W0(Z)ln(1fs)CL=C0(1fs)eW0(Z)Z=CSC0(1fs)ln(1fs)

Materials science

The Lambert W function is 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.[32]

Semiconductor

It was shown that a W-function describes the relation between voltage, current and resistance in a diode.[33]

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.[34]

Bernoulli numbers and Todd genus

The equation (linked with the generating functions of Bernoulli numbers and Todd genus):

Y=X1eX

can be solved by means of the two real branches W0 and W−1:

X(Y)={W1(YeY)W0(YeY)=YW0(YeY)for Y<1,W0(YeY)W1(YeY)=YW1(YeY)for 1<Y<0.

This application shows that the branch difference of the W function can be employed in order to solve other transcendental equations.[35]

Statistics

The centroid of a set of histograms defined with respect to the symmetrized Kullback–Leibler divergence (also called the Jeffreys divergence [36]) has a closed form using the Lambert W function.[37]

Pooling of tests for infectious diseases

Solving for the optimal group size to pool tests so that at least one individual is infected involves the Lambert W function.[38][39][40]

Exact solutions of the Schrödinger equation

The Lambert W function appears in a quantum-mechanical 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 one-dimensional Schrödinger equation in terms of the confluent hypergeometric functions. The potential is given as

V=V01+W(exσ).

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[41]

z=W(exσ).

The Lambert W function also appears in the exact solution for the bound state energy of the one dimensional Schrödinger equation with a Double Delta Potential.

Exact solution of QCD coupling constant

In Quantum chromodynamics, the quantum field theory of the Strong interaction, the coupling constant αs is computed perturbatively, the order n corresponding to Feynman diagrams including n quantum loops.[42] The first order, n = 1, solution is exact (at that order) and analytical. At higher orders, n > 1, there is no exact and analytical solution and one typically uses an iterative method to furnish an approximate solution. However, for second order, n = 2, the Lambert function provides an exact (if non-analytical) solution.[42]

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 Eddington–Finkelstein coordinates to the Schwarzschild coordinates. For this reason, it also appears in the construction of the Kruskal–Szekeres coordinates.

Resonances of the delta-shell potential

The s-wave resonances of the delta-shell potential can be written exactly in terms of the Lambert W function.[43]

Thermodynamic equilibrium

If a reaction involves reactants and products having heat capacities that are constant with temperature then the equilibrium constant K obeys

lnK=aT+b+clnT

for some constants a, b, and c. When c (equal to ΔCp/R) is not zero the value or values of T can be found where K equals a given value as follows, where L can be used for ln T.

a=(blnK)T+cTlnT=(blnK)eL+cLeLac=(blnKc+L)eLaceblnKc=(L+blnKc)eL+blnKcL=W(aceblnKc)+lnKbcT=exp(W(aceblnKc)+lnKbc).

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.

Phase separation of polymer mixtures

In the calculation of the phase diagram of thermodynamically incompatible polymer mixtures according to the Edmond-Ogston model, the solutions for binodal and tie-lines are formulated in terms of Lambert W functions.[44]

Wien's displacement law in a D-dimensional universe

Wien's displacement law is expressed as νmax/T=α=const. With x=hνmax/kBT and dρT(x)/dx=0, where ρT is the spectral energy energy density, one finds ex=1xD, where D is the number of degrees of freedom for spatial translation. The solution x=D+W(DeD) shows that the spectral energy density is dependent on the dimensionality of the universe.[45]

AdS/CFT correspondence

The classical finite-size corrections to the dispersion relations of giant magnons, single spikes and GKP strings can be expressed in terms of the Lambert W function.[46][47]

Epidemiology

In the t → ∞ limit of the SIR model, the proportion of susceptible and recovered individuals has a solution in terms of the Lambert W function.[48]

Determination of the time of flight of a projectile

The total time of the journey of a projectile which experiences air resistance proportional to its velocity can be determined in exact form by using the Lambert W function.[49]

Electromagnetic surface wave propagation

The transcendental equation that appears in the determination of the propagation wave number of an electromagnetic axially symmetric surface wave (a low-attenuation single TM01 mode) propagating in a cylindrical metallic wire gives rise to an equation like u ln u = v (where u and v clump together the geometrical and physical factors of the problem), which is solved by the Lambert W function. The first solution to this problem, due to Sommerfeld circa 1898, already contained an iterative method to determine the value of the Lambert W function.[50]

Orthogonal trajectories of real ellipses

The family of ellipses x2+(1ε2)y2=ε2 centered at (0,0) is parameterized by eccentricity ε. The orthogonal trajectories of this family are given by the differential equation (1y+y)dy=(1xx)dx whose general solution is the family y2=W0(x2exp(2Cx2)).

Generalizations

The standard Lambert W function expresses exact solutions to transcendental algebraic equations (in x) of the form:

ecx=a0(xr)

 

 

 

 

(1)

where a0, c and r are real constants. The solution is x=r+1cW(cecra0). Generalizations of the Lambert W function[51][52][53] include:

  • An application to general relativity and quantum mechanics (quantum gravity) in lower dimensions, in fact a link (unknown prior to 2007[54]) between these two areas, where the right-hand side of (1) is replaced by a quadratic polynomial in x:

    ecx=a0(xr1)(xr2),

     

     

     

     

    (2)

    where r1 and r2 are real distinct constants, the roots of the quadratic polynomial. Here, the solution is a function which has a single argument x but the terms like ri and a0 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 r1 = r2, 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 two-body 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 quantum-mechanical double-well Dirac delta function model for unequal charges in one dimension.

  • Analytical solutions of the eigenenergies of a special case of the quantum mechanical three-body problem, namely the (three-dimensional) hydrogen molecule-ion.[55] Here the right-hand side of (1) is replaced by a ratio of infinite order polynomials in x:

    ecx=a0i=1(xri)i=1(xsi)

     

     

     

     

    (3)

    where ri and si 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).[56]

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.[57]

Plots

Numerical evaluation

The W function may be approximated using Newton's method, with successive approximations to w = W(z) (so z = wew) being

wj+1=wjwjewjzewj+wjewj.

The W function may also be approximated using Halley's method,

wj+1=wjwjewjzewj(wj+1)(wj+2)(wjewjz)2wj+2

given in Corless et al.[4] to compute W.

For real x1/e, it may be approximated by the quadratic-rate recursive formula of R. Iacono and J.P. Boyd:[13]

wn+1(x)=wn(x)1+wn(x)(1+log(xwn(x))).

Lajos Lóczi proves[58] that by using this iteration with an appropriate starting value w0(x),

  • For the principal branch W0:
    • if x(e,): w0(x)=log(x)log(log(x)),
    • if x(0,e): w0(x)=x/e,
    • if x(1/e,0): w0(x)=exlog(1+1+ex)1+ex+1+ex,
  • For the branch W1:
    • if x(1/4,0): w0(x)=log(x)log(log(x)),
    • if x(1/e,1/4]: w0(x)=121+ex,

one can determine the maximum number of iteration steps in advance for any precision:

  • if x(e,) (Theorem 2.4): 0<W0(x)wn(x)<(log(1+1/e))2n,
  • if x(0,e) (Theorem 2.9): 0<W0(x)wn(x)<(11/e)2n15,
  • if x(1/e,0):
    • for the principal branch W0 (Theorem 2.17): 0<wn(x)W0(x)<(1/10)2n,
    • for the branch W1(Theorem 2.23): 0<W1(x)wn(x)<(1/2)2n.


Toshio Fukushima has presented a fast method for approximating the real valued parts of the principal and secondary branches of the W function without using any iteration.[59] In this method the W function is evaluated as a conditional switch of rational functions on transformed variables: W0(z)={Xk(x),(zk1<=z<zk,k=1,2,,17),Uk(u),(zk1<=z<zk,k=18,19), W1(z)={Yk(y),(zk1<=z<zk,k=1,2,,7),Vk(u),(zk1<=z<zk,k=8,9,10), where x, u, y and v are transformations of z:

x=z+1/e,u=lnz,y=z/(x+1/e),v=ln(z).

Here Xk(x), Uk(u), Yk(y), and Vk(v) are rational functions whose coefficients for different k-values are listed in the referenced paper together with the zk values that determine the subdomains. With higher degree polynomials in these rational functions the method can approximate the W function more accurately.

For example, when 1/ez2.0082178115844727, W0(z) can be approximated to 24 bits of accuracy on 64-bit floating point values as W0(z)X1(x)=i4Pixii3Qixi where x is defined with the transformation above and the coefficients Pi and Qi are given in the table below.

Coefficients
i Pi Qi
0 −0.9999999403954019 1
1 0.0557300521617778 2.275906559863465
2 2.1269732491053173 1.367597013868904
3 0.8135112367835288 0.18615823452831623
4 0.01632488014607016 0

Fukushima also offers an approximation with 50 bits of accuracy on 64-bit floats that uses 8th- and 7th-degree polynomials.

Software

The Lambert W function is implemented in many programming languages. Some of them are listed below:

Language Function name Required library
C/C++ gsl_sf_lambert_W0 and gsl_sf_lambert_Wm1 Special functions section of the GNU Scientific Library (GSL)[60]
lambert_w0, lambert_wm1, lambert_w0_prime, and lambert_wm1_prime Boost C++ libraries[61]
LambertW LambertW-function[62]
GP lambertw
Julia lambertw LambertW[63]
Maple LambertW[64]
Mathematica ProductLog (with LambertW as a silent alias)[65]
Matlab lambertw[66]
Maxima lambert_w[67]
Octave lambertw specfun[68]
PARI glambertW, lambertWC, glambertW_i, mplambertW, lambertW
Perl LambertW ntheory[69]
Python lambertw scipy[70]
R lambertW0 and lambertWm1 lamW[71]
Rust lambert_w, lambert_w0 and lambert_wm1 lambert_w[72]

See also

Notes

  1. Lehtonen, Jussi (April 2016), Rees, Mark, ed., "The Lambert W function in ecological and evolutionary models", Methods in Ecology and Evolution 7 (9): 1110–1118, doi:10.1111/2041-210x.12568, Bibcode2016MEcEv...7.1110L 
  2. Euler, Leonhard (1783), "De serie Lambertina plurimisque eius insignibus proprietatibus" (in la), Acta Academiae Scientiarum Imperialis Petropolitanae 1779 (II): 29–51, https://scholarlycommons.pacific.edu/euler-works/532/ 
  3. Chow, Timothy Y. (1999), "What is a closed-form number?", American Mathematical Monthly 106 (5): 440–448, doi:10.2307/2589148 .
  4. 4.0 4.1 4.2 4.3 4.4 Corless, R. M.; Gonnet, G. H.; Hare, D. E. G.; Jeffrey, D. J.; Knuth, D. E. (1996). "On the Lambert W function". Advances in Computational Mathematics 5: 329–359. doi:10.1007/BF02124750. https://cs.uwaterloo.ca/research/tr/1993/03/W.pdf. 
  5. Lambert J. H., "Observationes variae in mathesin puram", Acta Helveticae physico-mathematico-anatomico-botanico-medica, Band III, 128–168, 1758.
  6. 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.
  7. Scott, TC; Babb, JF; Dalgarno, A; Morgan, John D (Aug 15, 1993). "The calculation of exchange forces: General results and specific models" (in English). J. Chem. Phys. (American Institute of Physics) 99 (4): 2841–2854. doi:10.1063/1.465193. ISSN 0021-9606. Bibcode1993JChPh..99.2841S. 
  8. 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. 
  9. Mező, István (2022). The Lambert W Function: Its Generalizations and Applications. doi:10.1201/9781003168102. ISBN 978-1-003-16810-2. https://www.taylorfrancis.com/books/mono/10.1201/9781003168102/lambert-function-istv%C3%A1n-mez%C5%91. 
  10. Bronstein, Manuel; Corless, Robert M.; Davenport, James H.; Jeffrey, D. J. (2008). "Algebraic properties of the Lambert W function from a result of Rosenlicht and of Liouville". Integral Transforms and Special Functions 19 (10): 709–712. doi:10.1080/10652460802332342. http://opus.bath.ac.uk/27004/1/Davenport_ITSF_19_10_709.pdf. 
  11. Flajolet, Philippe; Sedgewick, Robert (2009-01-15). "Chapter II". Analytic Combinatorics. Cambridge University Press. ISBN 978-0-521-89806-5. https://doi.org/10.1017/cbo9780511801655. 
  12. 12.0 12.1 A. Hoorfar, M. Hassani, Inequalities on the Lambert W Function and Hyperpower Function, JIPAM, Theorem 2.7, page 7, volume 9, issue 2, article 51. 2008.
  13. 13.0 13.1 Iacono, Roberto; Boyd, John P. (2017-12-01). "New approximations to the principal real-valued branch of the Lambert W-function" (in en). Advances in Computational Mathematics 43 (6): 1403–1436. doi:10.1007/s10444-017-9530-3. ISSN 1572-9044. 
  14. Stewart, Seán M. (2009). "On certain inequalities involving the Lambert W function.". JIPAM. Journal of Inequalities in Pure & Applied Mathematics [electronic only] 10 (4): Paper No. 96, 4 p., electronic only–Paper No. 96, 4 p., electronic only. ISSN 1443-5756. https://eudml.org/doc/224588. 
  15. 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. doi:10.1109/LCOMM.2013.070113.130972. Bibcode2013IComL..17.1505C. 
  16. "Lambert function: Identities (formula 01.31.17.0001)". http://functions.wolfram.com/ElementaryFunctions/ProductLog/17/01/0001/. 
  17. "Lambert W-Function". http://mathworld.wolfram.com/LambertW-Function.html. 
  18. https://isa-afp.org/entries/Lambert_W.html Note: although one of the assumptions of the relevant lemma states that x must be > 1/e, inspection of said lemma reveals that this assumption is unused. The lower bound is in fact x > 0. The reason for the branch switch at e is simple: for x > 1 there are always two solutions, −ln x and another one that you'd get from the x on the other side of e that would feed the same value to W; these must crossover at x = e: [1] Wn cannot distinguish a value of ln x/x from an x < e from the same value from the other x > e, so it cannot flip the order of its return values.
  19. Finch, S. R. (2003). Mathematical constants. Cambridge University Press. p. 450. 
  20. Kalugin, German A.; Jeffrey, David J.; Corless, Robert M. (2012). "Bernstein, Pick, Poisson and related integral expressions for Lambert W". Integral Transforms and Special Functions 23 (11): 817–829. doi:10.1080/10652469.2011.640327. https://www.uwo.ca/apmaths/faculty/jeffrey/pdfs/BersteinPick.pdf.  See Theorem 3.4, p. 821 of published version (p. 5 of preprint).
  21. 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). RFNC-VNIIEF. p. 53. 
  22. 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 - ISSAC '97. pp. 197–204. doi:10.1145/258726.258783. ISBN 978-0-89791-875-6. 
  23. "The Lambert W Function". Ontario Research Centre for Computer Algebra. http://www.orcca.on.ca/LambertW/. 
  24. Barna, I.F.; Mátyás, L. (2013). "Analytic solutions for the one-dimensional compressible Euler equation with heat conduction closed with different kind of equation of states". Miskolc Mathematical Notes 13 (3): 785–799. doi:10.18514/MMN.2013.694. http://mat76.mat.uni-miskolc.hu/mnotes/article/694. 
  25. 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. Bibcode2006ChEnS..61.5515M. 
  26. Pellegrini, C. C.; Zappi, G. A.; Vilalta-Alonso, G. (2022-05-12). "An Analytical Solution for the Time-Dependent Flow in Simple Branch Hydraulic Systems with Centrifugal Pumps" (in en). Arabian Journal for Science and Engineering 47 (12): 16273–16287. doi:10.1007/s13369-022-06864-9. ISSN 2193-567X. https://link.springer.com/10.1007/s13369-022-06864-9. 
  27. Sotero, Roberto C.; Iturria-Medina, Yasser (2011). "From Blood oxygenation level dependent (BOLD) signals to brain temperature maps". Bull Math Biol 73 (11): 2731–47. doi:10.1007/s11538-011-9645-5. PMID 21409512. http://precedings.nature.com/documents/4772/version/1. 
  28. Braun, Artur; Wokaun, Alexander; Hermanns, Heinz-Guenter (2003). "Analytical Solution to a Growth Problem with Two Moving Boundaries". Appl Math Model 27 (1): 47–52. doi:10.1016/S0307-904X(02)00085-9. 
  29. 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 Unreacted-Core Model.". Chem Eng Sci 55 (22): 5273–5282. doi:10.1016/S0009-2509(00)00143-3. 
  30. Asadian, M; Saeedi, H; Yadegari, M; Shojaee, M (June 2014). "Determinations of equilibrium segregation, effective segregation and diffusion coefficients for Nd+3 doped in molten YAG". Journal of Crystal Growth 396 (15): 61–65. doi:10.1016/j.jcrysgro.2014.03.028. Bibcode2014JCrGr.396...61A.  https://doi.org/10.1016/j.jcrysgro.2014.03.028
  31. Asadian, M; Zabihi, F; Saeedi, H (March 2024). "Segregation and constitutional supercooling in Nd:YAG Czochralski crystal growth". Journal of Crystal Growth 630. doi:10.1016/j.jcrysgro.2024.127605. Bibcode2024JCrGr.63027605A.  https://doi.org/10.1016/j.jcrysgro.2024.127605
  32. 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. doi:10.1016/S0022-0248(02)00941-7. Bibcode2002JCrGr.241..231B. 
  33. Banwell, T.C.; Jayakumar, A. (2000). "Exact analytical solution for current flow through diode with series resistance". Electronics Letters 36 (1): 29–33. doi:10.1049/el:20000301. Bibcode2000ElL....36..291B. https://digital-library.theiet.org/doi/10.1049/el%3A20000301. 
  34. Colla, Pietro (2014). "A New Analytical Method for the Motion of a Two-Phase Interface in a Tilted Porous Medium". PROCEEDINGS, Thirty-Eighth Workshop on Geothermal Reservoir Engineering, Stanford University SGP-TR-202. ([2])
  35. D. J. Jeffrey and J. E. Jankowski, "Branch differences and Lambert W"
  36. Flavia-Corina Mitroi-Symeonidis; Ion Anghel; Shigeru Furuichi (2019). "Encodings for the calculation of the permutation hypoentropy and their applications on full-scale compartment fire data". Acta Technica Napocensis 62, IV: 607–616. 
  37. F. Nielsen, "Jeffreys Centroids: A Closed-Form Expression for Positive Histograms and a Guaranteed Tight Approximation for Frequency Histograms"
  38. https://arxiv.org/abs/2005.03051 J. Batson et al., "A COMPARISON OF GROUP TESTING ARCHITECTURES FOR COVID-19 TESTING".
  39. A.Z. Broder, "A Note on Double Pooling Tests".
  40. Rudolf Hanel, Stefan Thurner (2020). "Boosting test-efficiency by pooled testing for SARS-CoV-2—Formula for optimal pool size". PLOS ONE 15, 11 (11). doi:10.1371/journal.pone.0240652. PMID 33147228. Bibcode2020PLoSO..1540652H. 
  41. A.M. Ishkhanyan, "The Lambert W barrier – an exactly solvable confluent hypergeometric potential".
  42. 42.0 42.1 Deur, Alexandre; Brodsky, Stanley J.; De Téramond, Guy F. (2016). "The QCD running coupling". Progress in Particle and Nuclear Physics 90: 1–74. doi:10.1016/j.ppnp.2016.04.003. Bibcode2016PrPNP..90....1D. 
  43. de la Madrid, R. (2017). "Numerical calculation of the decay widths, the decay constants, and the decay energy spectra of the resonances of the delta-shell potential". Nucl. Phys. A 962: 24–45. doi:10.1016/j.nuclphysa.2017.03.006. Bibcode2017NuPhA.962...24D. 
  44. Bot, A.; Dewi, B.P.C.; Venema, P. (2021). "Phase-separating binary polymer mixtures: the degeneracy of the virial coefficients and their extraction from phase diagrams". ACS Omega 6 (11): 7862–7878. doi:10.1021/acsomega.1c00450. PMID 33778298. 
  45. Cardoso, T. R.; de Castro, A. S. (2005). "The blackbody radiation in a D-dimensional universe". Rev. Bras. Ens. Fis. 27 (4): 559–563. doi:10.1590/S1806-11172005000400007. 
  46. Floratos, Emmanuel; Georgiou, George; Linardopoulos, Georgios (2014). "Large-Spin Expansions of GKP Strings". JHEP 2014 (3): 0180. doi:10.1007/JHEP03(2014)018. Bibcode2014JHEP...03..018F. 
  47. Floratos, Emmanuel; Linardopoulos, Georgios (2015). "Large-Spin and Large-Winding Expansions of Giant Magnons and Single Spikes". Nucl. Phys. B 897: 229–275. doi:10.1016/j.nuclphysb.2015.05.021. Bibcode2015NuPhB.897..229F. 
  48. "Mathematica, Version 12.1". Champaign IL, 2020. https://www.wolfram.com/mathematica. 
  49. Packel, E.; Yuen, D. (2004). "Projectile motion with resistance and the Lambert W function". College Math. J. 35 (5): 337–341. doi:10.1080/07468342.2004.11922095. https://www.tandfonline.com/doi/abs/10.1080/07468342.2004.11922095?__cf_chl_tk=lMeR7eBE_W6KCd9mRFyIKS4ythC6fdxtjLT._Qtr73E-1735339489-1.0.1.1-x_kLQ7G4BLkGB79BTmnptVAM_5nuIi70PJ_IE47Mmc8. 
  50. Mendonça, J. R. G. (2019). "Electromagnetic surface wave propagation in a metallic wire and the Lambert W function". American Journal of Physics 87 (6): 476–484. doi:10.1119/1.5100943. Bibcode2019AmJPh..87..476M. 
  51. 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. doi:10.1007/s00200-006-0196-1. Bibcode2006math.ph...7011S. 
  52. Scott, T. C.; Fee, G.; Grotendorst, J. (2013). "Asymptotic series of Generalized Lambert W Function". ACM Communications in Computer Algebra 47 (185): 75–83. doi:10.1145/2576802.2576804. http://www.sigsam.org/cca/issues/issue185.html. 
  53. Scott, T. C.; Fee, G.; Grotendorst, J.; Zhang, W.Z. (2014). "Numerics of the Generalized Lambert W Function". ACM Communications in Computer Algebra 48 (1/2): 42–56. doi:10.1145/2644288.2644298. http://www.sigsam.org/cca/issues/issue188.html. 
  54. Farrugia, P. S.; Mann, R. B.; Scott, T. C. (2007). "N-body Gravity and the Schrödinger Equation". Class. Quantum Grav. 24 (18): 4647–4659. doi:10.1088/0264-9381/24/18/006. Bibcode2007CQGra..24.4647F. 
  55. Scott, T. C.; Aubert-Frécon, M.; Grotendorst, J. (2006). "New Approach for the Electronic Energies of the Hydrogen Molecular Ion". Chem. Phys. 324 (2–3): 323–338. doi:10.1016/j.chemphys.2005.10.031. Bibcode2006CP....324..323S. 
  56. Maignan, Aude; Scott, T. C. (2016). "Fleshing out the Generalized Lambert W Function". ACM Communications in Computer Algebra 50 (2): 45–60. doi:10.1145/2992274.2992275. 
  57. Scott, T. C.; Lüchow, A.; Bressanini, D.; Morgan, J. D. III (2007). "The Nodal Surfaces of Helium Atom Eigenfunctions". Phys. Rev. A 75 (6). doi:10.1103/PhysRevA.75.060101. Bibcode2007PhRvA..75f0101S. https://irinsubria.uninsubria.it/bitstream/11383/1679348/1/2007-scott-pra2007.pdf. 
  58. Lóczi, Lajos (2022-11-15). "Guaranteed- and high-precision evaluation of the Lambert W function" (in en). Applied Mathematics and Computation 433. doi:10.1016/j.amc.2022.127406. ISSN 0096-3003. https://www.researchgate.net/publication/362219191. 
  59. Fukushima, Toshio (2020-11-25). "Precise and fast computation of Lambert W function by piecewise minimax rational function approximation with variable transformation". doi:10.13140/RG.2.2.30264.37128. https://www.researchgate.net/publication/346309410. 
  60. "Lambert W Functions - GNU Scientific Library (GSL)". https://www.gnu.org/software/gsl/doc/html/specfunc.html#lambert-w-functions. 
  61. "Lambert W function - Boost libraries". https://www.boost.org/doc/libs/release/libs/math/doc/html/math_toolkit/lambert_w.html. 
  62. Mező, István (2017-12-05), LambertW-function, https://github.com/IstvanMezo/LambertW-function, retrieved 2024-12-13 
  63. "Lambert W function and associated omega constant". https://github.com/JuliaMath/LambertW.jl. 
  64. "LambertW - Maple Help". http://www.maplesoft.com/support/help/Maple/view.aspx?path=LambertW. 
  65. ProductLog - Wolfram Language Reference
  66. lambertw – MATLAB
  67. Maxima, a Computer Algebra System
  68. "lambertw - specfun on Octave-Forge". https://octave.sourceforge.io/specfun/function/lambertw.html. 
  69. ntheory - MetaCPAN
  70. "lambertw — SciPy v1.16.1 Manual". https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.lambertw.html#scipy.special.lambertw. 
  71. Adler, Avraham (2017-04-24), lamW: Lambert W Function, https://cran.r-project.org/web/packages/lamW/index.html, retrieved 2017-12-19 
  72. Sörngård, Johanna (2024-07-28), lambert_w, https://crates.io/crates/lambert_w, retrieved 2025-03-27 

References