Lambert W function
Imagine a mathematical function that, despite its deep historical roots, remained largely overlooked for centuries, only to emerge as a critical tool for solving complex problems across physics, biology, and computer science. This is the story of the Lambert W function, a unique 'product logarithm' that helps untangle equations where variables hide both inside and outside an exponential. Let's uncover the fascinating secrets of this remarkable mathematical tool. The Lambert W function solves equations where a variable appears both linearly and within an exponential, a structure found in many real-world problems. It is a 'multivalued' function, meaning for a given input, it can yield multiple outputs, represented by its various "branches." Despite its classical origins, its broad utility wasn't fully recognized until the age of computer algebra systems, revealing its hidden power in diverse scientific fields.
AI Summary
Imagine a mathematical function that, despite its deep historical roots, remained largely overlooked for centuries, only to emerge as a critical tool for solving complex problems across physics, biology, and computer science. This is the story of the Lambert W function, a unique 'product logarithm' that helps untangle equations where variables hide both inside and outside an exponential. Let's uncover the fascinating secrets of this remarkable mathematical tool.
- The Lambert W function solves equations where a variable appears both linearly and within an exponential, a structure found in many real-world problems.
- It is a 'multivalued' function, meaning for a given input, it can yield multiple outputs, represented by its various "branches."
- Despite its classical origins, its broad utility wasn't fully recognized until the age of computer algebra systems, revealing its hidden power in diverse scientific fields.
What is the Lambert W Function?
In the vast universe of mathematics, some functions stand out for their elegant ability to unlock previously unsolvable problems. The Lambert W function, also known as the omega function or product logarithm, is precisely one such marvel. It's defined by an inverse relationship, much like how a logarithm is the inverse of an exponential.
Specifically, if we have an equation of the form z = w e^w, where 'w' is some complex number and e^w is the exponential function, then 'w' is the Lambert W function of 'z'. We write this as w = W(z).
Input Output z W(z) where z = W(z) * e^(W(z))
What makes it truly fascinating—and a bit complex—is that it's a 'multivalued function.' Think of it like the complex logarithm, which can also yield multiple answers. For a single input 'z', there can be many possible values for 'w' that satisfy the defining equation.
These different possible solutions are called 'branches,' denoted as Wk(z), where 'k' is an integer. The most commonly used branch, W0(z), is known as the 'principal branch.' Each branch provides a distinct set of outputs.
When we restrict ourselves to real numbers, only two branches typically matter: W0 and W-1. The principal branch, W0(x), is defined for all x >= -1/e and y >= -1. The W-1(x) branch, however, is only defined for x between -1/e (inclusive) and 0 (exclusive), and y <= -1. The critical point where these branches meet and separate is at x = -1/e and y = -1.
Unlocking Hidden Solutions
Why do we need such a peculiar function? Because many real-world phenomena lead to equations where a variable appears both 'naked' and trapped inside an exponential, like x e^x = C. The Lambert W function provides a powerful, often exact, way to solve these otherwise intractable problems.
Its applications span vast scientific landscapes. In combinatorics, it helps count trees in graph theory. In physics, it solves equations for the maxima of Planck, Bose-Einstein, and Fermi-Dirac distributions. Even delay differential equations, which model systems where the rate of change depends on past values, often find solutions through the W function.
Take enzyme kinetics, a cornerstone of biochemistry. The time-course analysis of Michaelis-Menten kinetics, a fundamental model describing enzyme reactions, can be precisely solved using the Lambert W function, revealing insights into biological processes.
A Storied Past and Modern Rediscovery
The function bears the name of Johann Heinrich Lambert, who explored a related transcendental equation back in 1758. Building on his work, the brilliant Leonhard Euler described the function 'per se' in 1783, even deriving series solutions for it. Yet, for centuries, its properties remained largely unrecognized outside specialized circles.
It wasn't until the 1990s, propelled by the rise of computer algebra systems like Maple and the work of mathematicians like Rob Corless, that the Lambert W function truly gained widespread attention. Researchers realized its broad utility across numerous fields, often hidden under different notations and names.
The alternative name, 'product logarithm,' gives a hint to its nature. Just as the inverse of the exponential function e^w is the logarithm ln(w), the inverse of the product function w e^w is logically termed the 'product logarithm'.
Calculus of W
Like any well-behaved function, the Lambert W function can be differentiated and integrated. Its derivative can be found using implicit differentiation from its defining relation z = W(z) e^(W(z)). This process reveals a surprisingly elegant formula.
This formula holds true for most values of 'z', but importantly, it is undefined at z = 0 (for branches other than W0) and at the critical branch point z = -1/e.
\frac{dW}{dz} = \frac{W(z)}{z(1+W(z))} \quad \text{for } z \not\in \left\{0,-\frac{1}{e}\right\}Integrating the Lambert W function also yields a concise result, often achieved through a clever substitution. This allows us to calculate areas under its curves and explore its cumulative properties.
This integral formula highlights the interrelationship between the function, its input, and its value. A notable result from this is that the integral of W0(x) from 0 to e equals e - 1.
\int W(x)\,dx = x\left(W(x)-1+\frac{1}{W(x)}\right)+CSeries and Asymptotics
To understand the Lambert W function's behavior near specific points or at extreme values, we can use series expansions. For instance, around x = 0, the principal branch W0(x) can be expressed as an infinite series, a Taylor series.
This series converges for |x| < 1/e, giving us a way to approximate the function's value near the origin. For very large values of x, W0(x) can be approximated by a different, asymptotic expansion involving logarithms.
W_{0}(x)=\sum_{n=1}^{\infty} \frac{(-n)^{n-1}}{n!}x^{n} = x-x^{2}+\frac{3}{2}x^{3}-\frac{16}{6}x^{4}+\frac{125}{24}x^{5}-\cdotsTranscendental Nature
Crucially, the Lambert W function is a 'transcendental function' — it cannot be expressed using a finite combination of algebraic operations, exponentials, or logarithms. This profound property makes it a unique and powerful addition to the mathematical toolkit, demonstrating that new functions are sometimes necessary to solve fundamental problems.
Special Values
Like many special functions, the Lambert W function has a few 'special values' that are particularly interesting or useful. One such value is W0(1), which is approximately 0.56714, and is known as the Omega constant — the unique number Ω such that Ω e^Ω = 1.
Another elegant special value is W0(e) = 1. This occurs because if we substitute w=1 into z = w e^w, we get z = 1 e^1 = e. Therefore, by definition, W0(e) must be 1. These specific points often serve as anchors for understanding the function's overall behavior.
W_{0}(1)=\Omega \approx 0.56714329Article
Lambert W function
The product logarithm Lambert W function plotted in the complex plane from −2 − 2i to 2 + 2i
The graph of ${\displaystyle y=W(x)}$ for real ${\displaystyle x<6}$ and ${\displaystyle y>-4}$. The upper branch (blue) with ${\displaystyle y\geq -1}$ is the graph of the function ${\displaystyle W{0}}$ (principal branch), the lower branch (magenta) with ${\displaystyle y\leq -1}$ is the graph of the function ${\displaystyle W{-1}}$. The minimum value of ${\displaystyle x}$ is at ${\displaystyle \left\{-1/e,-1\right\}}$.
In mathematics, the Lambert W function, also called the omega function or product logarithm, is a multivalued function, namely the branches of the converse relation of the function ${\displaystyle f(w)=we^{w}}$, where w is any complex number and ${\displaystyle e^{w}}$ 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. Despite its early origins and wide use, its properties were not widely recognized until the 1990s thanks primarily to the work of Rob Corless.
For each integer ${\displaystyle k}$ there is one branch, denoted by ${\displaystyle W{k}\left(z\right)}$, which is a complex-valued function of one complex argument. ${\displaystyle W{0}}$ is known as the principal branch. These functions have the following property: if ${\displaystyle z}$ and ${\displaystyle w}$ are any complex numbers, then
${\displaystyle w=W{k}(z)\ \ {\text{ for some integer }}k.}$
When dealing with real numbers only, the two branches ${\displaystyle W{0}}$ and ${\displaystyle W{-1}}$ suffice: for real numbers ${\displaystyle x}$ and ${\displaystyle y}$ the equation
can be solved for ${\displaystyle y}$ only if ${\textstyle x\geq {\frac {-1}{e}}}$; yields ${\displaystyle y=W{0}\left(x\right)}$ if ${\displaystyle x\geq 0}$ and the two values ${\displaystyle y=W{0}\left(x\right)}$ and ${\displaystyle y=W{-1}\left(x\right)}$ if ${\textstyle {\frac {-1}{e}}\leq x<0}$.
The Lambert W function's branches cannot be expressed in terms of elementary functions. 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 ${\displaystyle y'\left(t\right)=a\ y\left(t-1\right)}$. 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 ${\textstyle -{\frac {1}{e}}}$.
The modulus of the principal branch of the Lambert W function, colored according to ${\displaystyle \arg W\left(z\right)}$
Terminology
Lambert W function
The notation convention chosen here (with ${\displaystyle W{0}}$ and ${\displaystyle W{-1}}$) follows the canonical reference on the Lambert W function by Corless, Gonnet, Hare, Jeffrey and Knuth.
The name "product logarithm" can be understood as follows: since the inverse function of ${\displaystyle f\left(w\right)=e^{w}}$ is termed the logarithm, it makes sense to call the inverse "function" of the product ${\displaystyle we^{w}}$ 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 ${\displaystyle W{0}\left(1\right)}$.
History
Lambert W function
Lambert first considered the related Lambert's Transcendental Equation in 1758, which led to an article by Leonhard Euler in 1783 that discussed the special case of ${\displaystyle we^{w}}$.
Both authors derived a series solution for their equations.
Once Euler had solved this equation, he considered the case ${\displaystyle a=b}$. Taking limits, he derived the equation
He then put ${\displaystyle a=1}$ and obtained a convergent series solution for the resulting equation, expressing ${\displaystyle x}$ in terms of ${\displaystyle c}$.
After taking derivatives with respect to ${\displaystyle x}$ and some manipulation, the standard form of the Lambert function is obtained.
In 1993, it was reported that the Lambert ${\displaystyle W}$ function provides an exact solution to the quantum-mechanical double-well Dirac delta function model for equal charges—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."
Another example where this function is found is in Michaelis–Menten kinetics.
Although it was widely believed that the Lambert ${\displaystyle W}$ function cannot be expressed in terms of elementary (Liouvillian) functions, the first published proof did not appear until 2008.
Elementary properties, branches and range
Lambert W function
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 ${\displaystyle \lim \limits {z\to 0}W{k}(z)=\;-\infty ,}$ for all k ≠ 0.
The branch point for the principal branch is at ${\displaystyle z=-e^{-1}}$, with the standard branch cut extending along the negative real axis to −∞+0i. 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 is conventionally taken along the entire negative real axis.
The functions Wk(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.
Inverse
Regions of the complex plane for which ${\displaystyle \ W{n}(z\ e^{z})=z\ ,}$ where ${\displaystyle \ z=x+i\ y~.}$ The darker boundaries of a particular region are included in the lighter region of the same color. The point at ${\displaystyle \ (-1,\ 0)\ }$ is included in both the ${\displaystyle \ n=-1\ }$ (purple) region and the ${\displaystyle \ n=0\ }$ (gray) region. Horizontal grid lines are in multiples of ${\displaystyle \ \pi ~.}$
The range plot above also delineates the regions in the complex plane where the simple inverse relationship ${\displaystyle \ W{n}(z\ e^{z})=z\ }$ is true. ${\displaystyle \ f=z\ e^{z}\ }$ implies that there exists an ${\displaystyle \ n\ }$ such that ${\displaystyle \ z=W{n}(f)=W{n}(z\ e^{z})\ ,}$ where ${\displaystyle \ n\ }$ depends upon the value of ${\displaystyle \ z~.}$
For real values of ${\displaystyle \ z\ ,}$ the value of the integer ${\displaystyle \ n\ }$ changes abruptly when ${\displaystyle \ z\ e^{z}\ }$ is at the branch cut of ${\displaystyle \ W{n}(z\ e^{z})\ ,}$ which means that ${\displaystyle \ z\ e^{z}\leq 0\ ,}$ except for ${\displaystyle \ n=0\ }$ where it is ${\displaystyle \ z\ e^{z}\leq -1/e~.}$
For complex ${\displaystyle \ z\ ,}$ define ${\displaystyle \ z=x+i\ y\ ,}$ where ${\displaystyle \ x\ }$ and ${\displaystyle \ y\ }$ are real, and expressing ${\displaystyle \ e^{z}\ }$ in polar coordinates, it is seen that
${\displaystyle {\begin{aligned}z\ e^{z}&=(x+i\ y)\ e^{x}\ (\cos y+i\ \sin y)\\&=e^{x}(x\ \cos y\ -\ y\ \sin y)\ +\ i\ e^{x}(x\ \sin y\ +\ y\ \cos y)\\\end{aligned}}}$
For ${\displaystyle \ n\neq 0\ ,}$ the branch cut for ${\displaystyle \ W{n}(z\ e^{z})\ }$ is the non-positive real axis, so that
${\displaystyle x\ \sin y\ +\ y\ \cos y=0\quad \Rightarrow \quad x=-y/\tan(y)\ ,}$
${\displaystyle (x\ \cos y\ -\ y\ \sin y)\ e^{x}~\leq ~0~.}$
For ${\displaystyle \ n=0\ ,}$ the branch cut for ${\displaystyle \ W{n}(z\ e^{z})\ }$ is the real axis with ${\displaystyle \ -\infty <z\leq -1/e\ ,}$ so that the inequality becomes
${\displaystyle (x\ \cos y-y\ \sin y)\ e^{x}~\leq ~-1/e\quad }$ or ${\displaystyle \quad (x\ \cos y-y\ \sin y)\ e^{x+1}~\leq ~-1~.}$
Inside the regions bounded by the above, there are no discontinuous changes in ${\displaystyle \ W{n}(z\ e^{z})\ ,}$ and those regions specify where the ${\displaystyle \ W\ }$ function is simply invertible, i.e. ${\displaystyle \ W{n}(z\ e^{z})=z~.}$
Transcendence
For each algebraic number ${\displaystyle z\neq 0}$, the numbers ${\displaystyle W{k}(z)}$ are transcendental. This can be proved as follows. Suppose that ${\displaystyle W{k}(z)}$ is algebraic. Then by the Lindemann–Weierstrass theorem we have ${\displaystyle e^{W{k}(z)}}$ is transcendental, but ${\displaystyle e^{W{k}(z)}={\frac {z}{W{k}(z)}}}$ which is algebraic, giving a contradiction.
Calculus
Derivative
By implicit differentiation, one can show that all branches of W satisfy the differential equation
${\displaystyle z(1+W){\frac {dW}{dz}}=W\quad {\text{for }}z\neq -{\frac {1}{e}}.}$
(W is not differentiable for z = −1/e.) As a consequence, that gets the following formula for the derivative of W:
${\displaystyle {\frac {dW}{dz}}={\frac {W(z)}{z(1+W(z))}}\quad {\text{for }}z\not \in \left\{0,-{\frac {1}{e}}\right\}.}$
Using the identity eW(z) = z/W(z), gives the following equivalent formula:
${\displaystyle {\frac {dW}{dz}}={\frac {1}{z+e^{W(z)}}}\quad {\text{for }}z\neq -{\frac {1}{e}}.}$
${\displaystyle {\frac {d^{n}W}{dz^{n}}}={\frac {P{n}(W(z))}{(z+e^{W(z)})^{n}(W(z)+1)^{n-1}}}\quad {\text{for }}n>0,\,z\neq -{\frac {1}{e}}.}$
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:
${\displaystyle {\frac {d^{n+1}W}{dz^{n+1}}}={\frac {(W(z)+1)P{n}'(W(z))+(1-3n-nW(z))P{n}(W(z))}{(n+e^{W(z)})^{n+1}(W(z)+1)^{n}}}\quad {\text{for }}n>0,\,z\neq -{\frac {1}{e}}.}$
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:
${\displaystyle {\begin{aligned}\int W(x)\,dx&=xW(x)-x+e^{W(x)}+C\\&=x\left(W(x)-1+{\frac {1}{W(x)}}\right)+C.\end{aligned}}}$
(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
${\displaystyle \int {0}^{e}W{0}(x)\,dx=e-1.}$
Asymptotic expansions
Lambert W function
By the Lagrange inversion theorem, the Taylor series of the principal branch ${\displaystyle W{0}(x)}$ around ${\displaystyle x=0}$ is:
${\displaystyle W{0}(x)=\sum {n=1}^{\infty }{\frac {(-n)^{n-1}}{n!}}x^{n}=x-x^{2}+{\tfrac {3}{2}}x^{3}-{\tfrac {16}{6}}x^{4}+{\tfrac {125}{24}}x^{5}-\cdots .}$
The radius of convergence is ${\displaystyle 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 ${\displaystyle (-\infty ,1/e]}$.
For large values ${\displaystyle x\to \infty }$, the real function ${\displaystyle W{0}(x)}$ is asymptotic to
${\displaystyle {\begin{aligned}W{0}(x)&=L{1}-L{2}+{\frac {L{2}}{L{1}}}+{\frac {L{2}\left(-2+L{2}\right)}{2L{1}^{2}}}+{\frac {L{2}\left(6-9L{2}+2L{2}^{2}\right)}{6L{1}^{3}}}+{\frac {L{2}\left(-12+36L{2}-22L{2}^{2}+3L{2}^{3}\right)}{12L{1}^{4}}}+\cdots \\[5pt]&=L{1}-L{2}+\sum {\ell =1}^{\infty }\sum {m=1}^{\ell }{\frac {(-1)^{\ell }\left[{\begin{smallmatrix}\ell \\\ell -m+1\end{smallmatrix}}\right]}{m!}}{\frac {L{2}^{m}}{L{1}^{\ell }}},\end{aligned}}}$
where L1 = ln x, L2 = ln ln x, and [n k] is a non-negative Stirling number of the first kind. Keeping only the first two terms of the expansion,
${\displaystyle W{0}(x)=\ln x-\ln \ln x+{\mathcal {o}}(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)).
Integer and complex powers
Integer powers of W0 also admit simple Taylor (or Laurent) series expansions at zero:
${\displaystyle W{0}(x)^{2}=\sum {n=2}^{\infty }{\frac {-2\left(-n\right)^{n-3}}{(n-2)!}}x^{n}=x^{2}-2x^{3}+4x^{4}-{\tfrac {25}{3}}x^{5}+18x^{6}-\cdots .}$
More generally, for r ∈ Z, the Lagrange inversion formula gives
${\displaystyle W{0}(x)^{r}=\sum {n=r}^{\infty }{\frac {-r\left(-n\right)^{n-r-1}}{(n-r)!}}x^{n},}$
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:
${\displaystyle \left({\frac {W{0}(x)}{x}}\right)^{r}=e^{-rW{0}(x)}=\sum {n=0}^{\infty }{\frac {r\left(n+r\right)^{n-1}}{n!}}\left(-x\right)^{n},}$
Bounds and inequalities
Lambert W function
A number of non-asymptotic bounds are known for the Lambert function.
Principal branch
Hoorfar and Hassani showed that the following bound holds for x ≥ e:
${\displaystyle \ln x-\ln \ln x+{\frac {\ln \ln x}{2\ln x}}\leq W{0}(x)\leq \ln x-\ln \ln x+{\frac {e}{e-1}}{\frac {\ln \ln x}{\ln x}}.}$
Roberto Iacono and John P. Boyd enhanced the bounds for x ≥ e as follows:
${\displaystyle \ln \left({\frac {x}{\ln x}}\right)-{\frac {\ln \left({\frac {x}{\ln x}}\right)}{1+\ln \left({\frac {x}{\ln x}}\right)}}\ln \left(1-{\frac {\ln \ln x}{\ln x}}\right)\leq W{0}(x)\leq \ln \left({\frac {x}{\ln x}}\right)-\ln \left(\left(1-{\frac {\ln \ln x}{\ln x}}\right)\left(1-{\frac {\ln \left(1-{\frac {\ln \ln x}{\ln x}}\right)}{1+\ln \left({\frac {x}{\ln x}}\right)}}\right)\right).}$
${\displaystyle W{0}(x)\leq \ln \left({\frac {x+y}{1+\ln(y)}}\right),}$
for every ${\displaystyle y>1/e}$ and ${\displaystyle x\geq -1/e}$, with equality only for ${\displaystyle x=y\ln(y)}$. The bound allows many other bounds to be derived, such as taking ${\displaystyle y=x+1}$ which gives the bound
${\displaystyle W{0}(x)\leq \ln \left({\frac {2x+1}{1+\ln(x+1)}}\right).}$
Bounds for the function ${\displaystyle W{0}(-xe^{-x})}$ for ${\displaystyle x\geq 1}$ are obtained by Stewart.
Secondary branch
${\displaystyle -1-{\sqrt {2u}}-u<W{-1}\left(-e^{-u-1}\right)<-1-{\sqrt {2u}}-{\tfrac {2}{3}}u\quad {\text{for }}u>0.}$
Identities
Lambert W function
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 W2(z) plotted in the complex plane from −2 − 2i to 2 + 2i
${\displaystyle {\begin{aligned}W{0}(xe^{x})&=x&{\text{for }}x&\geq -1,\\W{-1}(xe^{x})&=x&{\text{for }}x&\leq -1.\end{aligned}}}$
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.
${\displaystyle {\begin{aligned}&W(x)e^{W(x)}=x,\quad {\text{therefore:}}\\[5pt]&e^{W(x)}={\frac {x}{W(x)}},\qquad e^{-W(x)}={\frac {W(x)}{x}},\qquad e^{nW(x)}=\left({\frac {x}{W(x)}}\right)^{n}.\end{aligned}}}$ ${\displaystyle \ln W{0}(x)=\ln x-W{0}(x)\quad {\text{for }}x>0.}$ ${\displaystyle W{0}\left(x\ln x\right)=\ln x\quad {\text{and}}\quad e^{W{0}\left(x\ln x\right)}=x\quad {\text{for }}{\frac {1}{e}}\leq x.}$ ${\displaystyle W{-1}\left(x\ln x\right)=\ln x\quad {\text{and}}\quad e^{W{-1}\left(x\ln x\right)}=x\quad {\text{for }}0<x\leq {\frac {1}{e}}.}$ ${\displaystyle {\begin{aligned}&W(x)=\ln {\frac {x}{W(x)}}&&{\text{for }}x\geq -{\frac {1}{e}},\\[5pt]&W\left({\frac {nx^{n}}{W\left(x\right)^{n-1}}}\right)=nW(x)&&{\text{for }}n,x>0\end{aligned}}}$ ${\displaystyle W(x)+W(y)=W\left(xy\left({\frac {1}{W(x)}}+{\frac {1}{W(y)}}\right)\right)\quad {\text{for }}x,y>0.}$
${\displaystyle {\begin{aligned}W{0}\left(-{\frac {\ln x}{x}}\right)&=-\ln x&{\text{for }}0&<x\leq e,\\[5pt]W{-1}\left(-{\frac {\ln x}{x}}\right)&=-\ln x&{\text{for }}x&>e.\end{aligned}}}$
${\displaystyle {\begin{aligned}h(x)&=e^{-W(-\ln x)}\\&={\frac {W(-\ln x)}{-\ln x}}\quad {\text{for }}x\neq 1.\end{aligned}}}$
${\displaystyle \forall c\in \left[-{\frac {1}{e}},0\right),{\text{let }}t={\frac {W{-1}(c)}{W{0}(c)}}\geq 1\implies W{0}(c)={\frac {\ln t}{1-t}},W{-1}(c)={\frac {t\ln t}{1-t}}}$
Special values
Lambert W function
The following are special values of the principal branch: ${\displaystyle W{0}\left(-{\frac {\pi }{2}}\right)={\frac {i\pi }{2}}}$ ${\displaystyle W{0}\left(-{\frac {1}{e}}\right)=-1}$ ${\displaystyle W{0}\left(2\ln 2\right)=\ln 2}$ ${\displaystyle W{0}\left(x\ln x\right)=\ln x\quad \left(x\geqslant {\tfrac {1}{e}}\approx 0.36788\right)}$ ${\displaystyle W{0}\left(x^{x+1}\ln x\right)=x\ln x\quad \left(x>0\right)}$ ${\displaystyle W{0}(0)=0}$
${\displaystyle W{0}(1)=\Omega \approx 0.56714329\quad }$ (the omega constant)
${\displaystyle W{0}(1)=e^{-W{0}(1)}=\ln {\frac {1}{W{0}(1)}}=-\ln W{0}(1)}$ ${\displaystyle W{0}(e)=1}$ ${\displaystyle W{0}\left(e^{1+e}\right)=e}$ ${\displaystyle W{0}\left({\frac {\sqrt {e}}{2}}\right)={\frac {1}{2}}}$ ${\displaystyle W{0}\left({\frac {\sqrt[{n}]{e}}{n}}\right)={\frac {1}{n}}}$ ${\displaystyle W{0}(-1)\approx -0.31813+1.33723i}$
Special values of the branch W−1: ${\displaystyle W{-1}\left(-{\frac {\ln 2}{2}}\right)=-\ln 4}$
Representations
Lambert W function
The principal branch of the Lambert function can be represented by a proper integral, due to Poisson:
${\displaystyle -{\frac {\pi }{2}}W{0}(-x)=\int {0}^{\pi }{\frac {\sin \left({\tfrac {3}{2}}t\right)-xe^{\cos t}\sin \left({\tfrac {5}{2}}t-\sin t\right)}{1-2xe^{\cos t}\cos(t-\sin t)+x^{2}e^{2\cos t}}}\sin \left({\tfrac {1}{2}}t\right)\,dt\quad {\text{for }}|x|<{\frac {1}{e}}.}$
Another representation of the principal branch was found by Kalugin–Jeffrey–Corless:
${\displaystyle W{0}(x)={\frac {1}{\pi }}\int {0}^{\pi }\ln \left(1+x{\frac {\sin t}{t}}e^{t\cot t}\right)dt.}$
The following continued fraction representation also holds for the principal branch:
${\displaystyle W{0}(x)={\cfrac {x}{1+{\cfrac {x}{1+{\cfrac {x}{2+{\cfrac {5x}{3+{\cfrac {17x}{10+{\cfrac {133x}{17+{\cfrac {1927x}{190+{\cfrac {13582711x}{94423+\ddots }}}}}}}}}}}}}}}}.}$
${\displaystyle W{0}(x)={\cfrac {x}{\exp {\cfrac {x}{\exp {\cfrac {x}{\ddots }}}}}}.}$
${\displaystyle W{0}(x)=\ln {\cfrac {x}{\ln {\cfrac {x}{\ln {\cfrac {x}{\ddots }}}}}}.}$
Other formulas
Definite integrals
There are several useful definite integral formulas involving the principal branch of the W function, including the following:
${\displaystyle {\begin{aligned}&\int {0}^{\pi }W{0}\left(2\cot ^{2}x\right)\sec ^{2}x\,dx=4{\sqrt {\pi }},\\[5pt]&\int {0}^{\infty }{\frac {W{0}(x)}{x{\sqrt {x}}}}\,dx=2{\sqrt {2\pi }},\\[5pt]&\int {0}^{\infty }W{0}\left({\frac {1}{x^{2}}}\right)\,dx={\sqrt {2\pi }},{\text{ and more generally}}\\[5pt]&\int {0}^{\infty }W{0}\left({\frac {1}{x^{N}}}\right)\,dx=N^{1-{\frac {1}{N}}}\Gamma \left(1-{\frac {1}{N}}\right)\qquad {\text{for }}N>1\end{aligned}}}$
where ${\displaystyle \Gamma }$ 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
${\displaystyle {\begin{aligned}x&=ue^{u},\\[5pt]{\frac {dx}{du}}&=(u+1)e^{u}.\end{aligned}}}$
${\displaystyle {\begin{aligned}\int {0}^{\infty }{\frac {W{0}(x)}{x{\sqrt {x}}}}\,dx&=\int {0}^{\infty }{\frac {u}{ue^{u}{\sqrt {ue^{u}}}}}(u+1)e^{u}\,du\\[5pt]&=\int {0}^{\infty }{\frac {u+1}{\sqrt {ue^{u}}}}du\\[5pt]&=\int {0}^{\infty }{\frac {u+1}{\sqrt {u}}}{\frac {1}{\sqrt {e^{u}}}}du\\[5pt]&=\int {0}^{\infty }u^{\tfrac {1}{2}}e^{-{\frac {u}{2}}}du+\int {0}^{\infty }u^{-{\tfrac {1}{2}}}e^{-{\frac {u}{2}}}du\\[5pt]&=2\int {0}^{\infty }(2w)^{\tfrac {1}{2}}e^{-w}\,dw+2\int {0}^{\infty }(2w)^{-{\tfrac {1}{2}}}e^{-w}\,dw&&\quad (u=2w)\\[5pt]&=2{\sqrt {2}}\int {0}^{\infty }w^{\tfrac {1}{2}}e^{-w}\,dw+{\sqrt {2}}\int {0}^{\infty }w^{-{\tfrac {1}{2}}}e^{-w}\,dw\\[5pt]&=2{\sqrt {2}}\cdot \Gamma \left({\tfrac {3}{2}}\right)+{\sqrt {2}}\cdot \Gamma \left({\tfrac {1}{2}}\right)\\[5pt]&=2{\sqrt {2}}\left({\tfrac {1}{2}}{\sqrt {\pi }}\right)+{\sqrt {2}}\left({\sqrt {\pi }}\right)\\[5pt]&=2{\sqrt {2\pi }}.\end{aligned}}}$
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, ${\displaystyle u={\frac {1}{x^{N}}}}$, ${\displaystyle t=W{0}(u)}$, and ${\displaystyle z={\frac {t}{N}}}$, 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:
${\displaystyle {\begin{aligned}W{0}(z)&={\frac {z}{2\pi }}\int {-\pi }^{\pi }{\frac {\left(1-\nu \cot \nu \right)^{2}+\nu ^{2}}{z+\nu \csc \left(\nu \right)e^{-\nu \cot \nu }}}\,d\nu \\[5pt]&={\frac {z}{\pi }}\int {0}^{\pi }{\frac {\left(1-\nu \cot \nu \right)^{2}+\nu ^{2}}{z+\nu \csc \left(\nu \right)e^{-\nu \cot \nu }}}\,d\nu ,\end{aligned}}}$
where the two integral expressions are equivalent due to the symmetry of the integrand.
Indefinite integrals
${\displaystyle \int {\frac {W(x)}{x}}\,dx\;=\;{\frac {W(x)^{2}}{2}}+W(x)+C}$
$${\displaystyle u=W(x)\rightarrow ue^{u}=x\;\;\;\;{\frac {d}{du}}ue^{u}=(u+1)e^{u}}$$
$${\displaystyle W(x)e^{W(x)}=x\rightarrow {\frac {W(x)}{x}}=e^{-W(x)}}$$
${\displaystyle \int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(Ae^{Bx}\right)^{2}}{2B}}+{\frac {W\left(Ae^{Bx}\right)}{B}}+C}$
$${\displaystyle \int W\left(Ae^{Bx}\right)\,dx\;=\;\int W\left(Ae^{Bx}\right)\,dx}$$
${\displaystyle \int {\frac {W(x)}{x^{2}}}\,dx\;=\;\operatorname {Ei} \left(-W(x)\right)-e^{-W(x)}+C}$
Applications
General case
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.
(where x is an unknown real number) can be solved by rewriting it as
${\displaystyle {\begin{aligned}&(x+1)\ 3^{-x}={\frac {1}{2}}&({\mbox{multiply by }}3^{-x}/2)\\\Leftrightarrow \ &(-x-1)\ 3^{-x-1}=-{\frac {1}{6}}&({\mbox{multiply by }}{-}1/3)\\\Leftrightarrow \ &(\ln 3)(-x-1)\ e^{(\ln 3)(-x-1)}=-{\frac {\ln 3}{6}}&({\mbox{multiply by }}\ln 3)\end{aligned}}}$
This last equation has the desired form and the solutions for real x are:
${\displaystyle (\ln 3)(-x-1)=W{0}\left({\frac {-\ln 3}{6}}\right)\ \ \ {\textrm {or}}\ \ \ (\ln 3)(-x-1)=W{-1}\left({\frac {-\ln 3}{6}}\right)}$
${\displaystyle x=-1-{\frac {W{0}\left(-{\frac {\ln 3}{6}}\right)}{\ln 3}}=-0.79011\ldots \ \ {\textrm {or}}\ \ x=-1-{\frac {W{-1}\left(-{\frac {\ln 3}{6}}\right)}{\ln 3}}=1.44456\ldots }$
${\displaystyle x=a-{\frac {1}{c}}W(-bc\,e^{ac})}$
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.
Super root
Along with the topic of the so called Sophomore's dream the tetration function ${\displaystyle f(x)=x^{x}}$ became a well known function. Its inverse function is a special case of the so called super root and it can be determined and displayed as follows:
And in the final step the second last equation will be divided by the last equation:
${\displaystyle x={\frac {\ln(y)}{W{0}[\ln(y)]}}}$
${\displaystyle x=\ln(2)\div W{0}[\ln(2)]\approx 1.559610469462369349970388768765}$
Tree counting and combinatorics
Cayley's formula states that the number of tree graphs on n labeled vertices is ${\displaystyle n^{n-2}}$, so that the number of trees with a designated root vertex is ${\displaystyle n^{n-1}}$. The exponential generating function of this counting sequence is:
${\displaystyle T(x)=\sum {n=0}^{\infty }{\frac {n^{n-1}}{n!}}x^{n}.}$
The class of rooted trees has a natural recurrence: a rooted tree is equivalent to a root vertex attached to a set of smaller rooted trees. Using the exponential formula for labeled combinatorial classes, this translates into the equation:
which implies ${\displaystyle -T(-x)e^{-T(-x)}=x}$ and
Reversing the argument, the Maclaurin series of ${\displaystyle W{0}(x)}$ around ${\displaystyle x=0}$ can be found directly using the Lagrange inversion theorem:
${\displaystyle W{0}(x)=\sum {n=1}^{\infty }{\frac {(-n)^{n-1}}{n!}}x^{n},}$
and this gives the standard analytic proof of Cayley's formula. But the Maclaurin series radius of convergence is limited to ${\displaystyle |x|<1/e}$ because of the branch point at ${\displaystyle x=-1/e}$.
Inviscid flows
Applying the unusual accelerating traveling-wave Ansatz in the form of ${\displaystyle \rho (\eta )=\rho {\big (}x-{\frac {at^{2}}{2}}{\big )}}$ (where ${\displaystyle \rho }$, ${\displaystyle \eta }$, 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.
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:
${\displaystyle H(x)=1+W\left((H(0)-1)e^{(H(0)-1)-{\frac {x}{L}}}\right),}$
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.
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. The Lambert W function provided an exact solution to the flow rate of fluid in both the laminar and turbulent regimes: ${\displaystyle {\begin{aligned}Q{\text{turb}}&={\frac {Q{i}}{\zeta {i}}}W{0}\left[\zeta {i}\,e^{(\zeta {i}+\beta t/b)}\right]\\Q{\text{lam}}&={\frac {Q{i}}{\xi {i}}}W{0}\left[\xi {i}\,e^{\left(\xi {i}+\beta t/(b-\Gamma {1})\right)}\right]\end{aligned}}}$ where ${\displaystyle Q{i}}$ is the initial flow rate and ${\displaystyle 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.
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.
Crystal growth
In the crystal growth, the negative principal of the Lambert W-function can be used to calculate the distribution coefficient, ${\textstyle k}$, and solute concentration in the melt, ${\textstyle C{L}}$, from the Scheil equation:
${\displaystyle {\begin{aligned}&k={\frac {W{0}(Z)}{\ln(1-fs)}}\\&C{L}={\frac {C{0}}{(1-fs)}}e^{W{0}(Z)}\\&Z={\frac {C{S}}{C{0}}}(1-fs)\ln(1-fs)\end{aligned}}}$
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.
Semiconductor devices
It was shown that a W-function describes the relation between voltage, current and resistance in a diode.
The use of the Lambert W Function to analytically and exactly solve the terminals' current and voltage as explicit functions of each other in a circuit model of a diode with both series and shunt resistances was first reported in the year 2000.
The Lambert W Function was introduced into compact modeling of MOSFETs in 2003 as a useful mathematical tool to explicitly describe the surface potential in undoped channels.
The Lambert W function-based explicit analytic solution of the illuminated photovoltaic solar cell single-diode model with parasitic series and shunt resistance was published in 2004.
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.
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 W0 and W−1:
${\displaystyle X(Y)={\begin{cases}W{-1}\left(Ye^{Y}\right)-W{0}\left(Ye^{Y}\right)=Y-W{0}\left(Ye^{Y}\right)&{\text{for }}Y<-1,\\W{0}\left(Ye^{Y}\right)-W{-1}\left(Ye^{Y}\right)=Y-W{-1}\left(Ye^{Y}\right)&{\text{for }}-1<Y<0.\end{cases}}}$
This application shows that the branch difference of the W function can be employed in order to solve other transcendental equations.
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.
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.
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
${\displaystyle V={\frac {V{0}}{1+W\left(e^{-{\frac {x}{\sigma }}}\right)}}.}$
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
${\displaystyle z=W\left(e^{-{\frac {x}{\sigma }}}\right).}$
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 ${\displaystyle \alpha {\text{s}}}$ is computed perturbatively, the order n corresponding to Feynman diagrams including n quantum loops. 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.
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.
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 Δ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.
${\displaystyle {\begin{aligned}-a&=(b-\ln K)T+cT\ln T\\&=(b-\ln K)e^{L}+cLe^{L}\\[5pt]-{\frac {a}{c}}&=\left({\frac {b-\ln K}{c}}+L\right)e^{L}\\[5pt]-{\frac {a}{c}}e^{\frac {b-\ln K}{c}}&=\left(L+{\frac {b-\ln K}{c}}\right)e^{L+{\frac {b-\ln K}{c}}}\\[5pt]L&=W\left(-{\frac {a}{c}}e^{\frac {b-\ln K}{c}}\right)+{\frac {\ln K-b}{c}}\\[5pt]T&=\exp \left(W\left(-{\frac {a}{c}}e^{\frac {b-\ln K}{c}}\right)+{\frac {\ln K-b}{c}}\right).\end{aligned}}}$
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.
Wien's displacement law in a D-dimensional universe
Wien's displacement law is expressed as ${\displaystyle \nu {\max }/T=\alpha =\mathrm {const} }$. With ${\displaystyle x=h\nu {\max }/k{\mathrm {B} }T}$ and ${\displaystyle d\rho {T}\left(x\right)/dx=0}$, where ${\displaystyle \rho {T}}$ is the spectral energy energy density, one finds ${\displaystyle e^{-x}=1-{\frac {x}{D}}}$, where ${\displaystyle D}$ is the number of degrees of freedom for spatial translation. The solution ${\displaystyle x=D+W\left(-De^{-D}\right)}$ shows that the spectral energy density is dependent on the dimensionality of the universe.
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.
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.
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.
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.
Orthogonal trajectories of real ellipses
The family of ellipses ${\displaystyle x^{2}+(1-\varepsilon ^{2})y^{2}=\varepsilon ^{2}}$ centered at ${\displaystyle (0,0)}$ is parameterized by eccentricity ${\displaystyle \varepsilon }$. The orthogonal trajectories of this family are given by the differential equation ${\displaystyle \left({\frac {1}{y}}+y\right)dy=\left({\frac {1}{x}}-x\right)dx}$ whose general solution is the family ${\displaystyle y^{2}=}$${\displaystyle W{0}(x^{2}\exp(-2C-x^{2}))}$.
Generalizations
Lambert W function
The standard Lambert W function expresses exact solutions to transcendental algebraic equations (in x) of the form:
where a0, c and r are real constants. The solution is ${\displaystyle x=r+{\frac {1}{c}}W\left({\frac {c\,e^{-cr}}{a{0}}}\right).}$ Generalizations of the Lambert W function include:
• An application to general relativity and quantum mechanics (quantum gravity) in lower dimensions, in fact a link (unknown prior to 2007) between these two areas, where the right-hand side of ((/wiki/LambertWfunction#math1)) is replaced by a quadratic polynomial in x: 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 ((/wiki/LambertWfunction#math2)) can be factored and reduced to ((/wiki/LambertWfunction#math1)) and thus the solution reduces to that of the standard W function. Equation ((/wiki/LambertWfunction#math2)) 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. Here the right-hand side of ((/wiki/LambertWfunction#math1)) is replaced by a ratio of infinite order polynomials in x: where ri and si are distinct real constants and x is a function of the eigenenergy and the internuclear distance R. Equation ((/wiki/LambertWfunction#math3)) with its specialized cases expressed in ((/wiki/LambertWfunction#math1)) and ((/wiki/LambertWfunction#math2)) 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 ((/wiki/LambertWfunction#math3)).
Applications of the Lambert W function in fundamental physical problems are not exhausted even for the standard case expressed in ((/wiki/LambertWfunction#math1)) as seen recently in the area of atomic, molecular, and optical physics.
Plots
Lambert W function
• Plots of the Lambert W function on the complex plane • z = Re(W0(x + iy)) • z = Im(W0(x + iy)) • z = |W0(x + iy)| • Superimposition of the previous three plots
Numerical evaluation
Lambert W function
The W function may be approximated using Newton's method, with successive approximations to w = W(z) (so z = wew) being
${\displaystyle w{j+1}=w{j}-{\frac {w{j}e^{w{j}}-z}{w{j}e^{w{j}}+e^{w{j}}}}.}$
Faster convergence may be obtained using Halley's method,
${\displaystyle w{j+1}=w{j}-{\frac {w{j}e^{w{j}}-z}{w{j}e^{w{j}}+e^{w{j}}-{\dfrac {\left(w{j}+2\right)\left(w{j}e^{w{j}}-z\right)}{2w{j}+2}}}}}$
given in Corless et al. Because the computation time is dominated by the exponential function, this is only slightly more expensive than Newton's method.
For real ${\displaystyle x\geq -1/e}$, it may be approximated by the quadratic-rate recursive formula of R. Iacono and J.P. Boyd:
${\displaystyle w{n+1}(x)={\frac {w{n}(x)}{1+w{n}(x)}}\left(1+\log \left({\frac {x}{w{n}(x)}}\right)\right).}$
Lajos Lóczi proves that by using this iteration with an appropriate starting value ${\displaystyle w{0}(x)}$,
• For the principal branch ${\displaystyle W{0}:}$ • if ${\displaystyle x\in (e,\infty )}$: ${\displaystyle w{0}(x)=\log(x)-\log(\log(x)),}$ • if ${\displaystyle x\in (0,e):}$ ${\displaystyle w{0}(x)=x/e,}$ • if ${\displaystyle x\in (-1/e,0):}$ ${\displaystyle w{0}(x)={\frac {ex\log(1+{\sqrt {1+ex}})}{1+ex+{\sqrt {1+ex}}}},}$ • For the branch ${\displaystyle W{-1}:}$ • if ${\displaystyle x\in (-1/4,0):}$ ${\displaystyle w{0}(x)=\log(-x)-\log(-\log(-x)),}$ • if ${\displaystyle x\in (-1/e,-1/4]:}$ ${\displaystyle w{0}(x)=-1-{\sqrt {2}}{\sqrt {1+ex}},}$
one can determine the maximum number of iteration steps in advance for any precision:
• if ${\displaystyle x\in (e,\infty )}$ (Theorem 2.4): ${\displaystyle 0<W{0}(x)-w{n}(x)<\left(\log(1+1/e)\right)^{2^{n}},}$ • if ${\displaystyle x\in (0,e)}$ (Theorem 2.9): ${\displaystyle 0<W{0}(x)-w{n}(x)<{\frac {\left(1-1/e\right)^{2^{n}-1}}{5}},}$ • if ${\displaystyle x\in (-1/e,0):}$ • for the principal branch ${\displaystyle W{0}}$ (Theorem 2.17): ${\displaystyle 0<w{n}(x)-W{0}(x)<\left(1/10\right)^{2^{n}},}$ • for the branch ${\displaystyle W{-1}}$(Theorem 2.23): ${\displaystyle 0<W{-1}(x)-w{n}(x)<\left(1/2\right)^{2^{n}}.}$
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. In this method the W function is evaluated as a conditional switch of minimax rational functions on transformed variables: ${\displaystyle W{0}(z)={\begin{cases}X{k}(x),&(z{k-1}\leq z<z{k},\quad k=1,2,\ldots ,17),\\U{k}(u),&(z{k-1}\leq z<z{k},\quad k=18,19),\end{cases}}}$ ${\displaystyle W{-1}(z)={\begin{cases}Y{k}(y),&(z{k-1}\leq z<z{k},\quad k=-1,-2,\ldots ,-7),\\V{k}(v),&(z{k-1}\leq z<z{k},\quad k=-8,-9,-10),\end{cases}}}$ where u, v, x, and y are transformations of z:
${\displaystyle u=\ln {z},\quad v=\ln(-z),\quad x={\sqrt {z+1/e}},\quad y=-z/(x+1/{\sqrt {e}})}$.
Here ${\displaystyle U{k}(u)}$, ${\displaystyle V{k}(v)}$, ${\displaystyle X{k}(x)}$, and ${\displaystyle Y{k}(y)}$ are rational functions whose coefficients for different k-values are listed in the referenced paper together with the ${\displaystyle z{k}}$ values that determine their subdomains. With higher degree polynomials in these rational functions the method can approximate the W function more accurately.
For example, when ${\displaystyle -1/e\leq z\leq 2.0082178115844727}$, ${\displaystyle W{0}(z)}$ can be approximated to 24 bits of accuracy on 64-bit floating point values as ${\displaystyle W{0}(z)\approx X{1}(x)={\frac {\sum {i}^{4}P{i}x^{i}}{\sum {i}^{3}Q{i}x^{i}}}}$ where x is defined with the transformation above and the coefficients ${\displaystyle P{i}}$ and ${\displaystyle Q{i}}$ are given in the table below.
<table><thead><tr><th>{\displaystyle i}</th><th>{\displaystyle P{i}}</th><th>{\displaystyle Q{i}}</th></tr></thead><tbody><tr><td>0</td><td>−0.9999999403954019</td><td>1</td></tr><tr><td>1</td><td>0.0557300521617778</td><td>2.275906559863465</td></tr><tr><td>2</td><td>2.1269732491053173</td><td>1.367597013868904</td></tr><tr><td>3</td><td>0.8135112367835288</td><td>0.18615823452831623</td></tr><tr><td>4</td><td>0.01632488014607016</td><td>0</td></tr></tbody></table>
Fukushima also offers an approximation with 50 bits of accuracy on 64-bit floats that uses 8th- and 7th-degree polynomials.
Software
Lambert W function
The Lambert W function is implemented in many programming languages. Some of them are listed below:
<table><thead><tr><th>Language</th><th>Function name</th><th>Required library</th></tr></thead><tbody><tr><td>C/C++</td><td>gslsflambertW0 and gslsflambertWm1</td><td>Special functions section of the GNU Scientific Library (GSL)</td></tr><tr><td>lambertw0, lambertwm1, lambertw0prime, and lambertwm1prime</td><td>Boost C++ libraries</td></tr><tr><td>LambertW</td><td>LambertW-function</td></tr><tr><td>GP</td><td>lambertw</td><td></td></tr><tr><td>Julia</td><td>lambertw</td><td>LambertW</td><td></td></tr><tr><td>Maple</td><td>LambertW</td><td></td></tr><tr><td>Mathematica</td><td>ProductLog (with LambertW as a silent alias)</td><td></td></tr><tr><td>Matlab</td><td>lambertw</td><td></td></tr><tr><td>Maxima</td><td>lambertw</td><td></td></tr><tr><td>Octave</td><td>lambertw</td><td>specfun</td></tr><tr><td>PARI</td><td>glambertW, lambertWC, glambertWi, mplambertW, lambertW</td><td></td></tr><tr><td>Perl</td><td>LambertW</td><td>ntheory</td></tr><tr><td>Python</td><td>lambertw</td><td>scipy</td></tr><tr><td>R</td><td>lambertW0 and lambertWm1</td><td>lamW</td></tr><tr><td>Rust</td><td>lambertw, lambertw0 and lambertwm1</td><td>lambertw</td></tr></tbody></table>