# Lambert W function

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 f(w) = we$^w$, where w is any complex number and 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.
For each integer k there is one branch, denoted by W$_k$(z), which is a complex-valued function of one complex argument. W$_0$ is known as the principal branch. These functions have the following property: if z and w are any complex numbers, then
    $we^{w}=z$
holds if and only if
    $w=W_{k}(z)\ \ {\text{ for some integer }}k.$
When dealing with real numbers only, the two branches W$_0$ and W$_{−1}$ suffice: for real numbers x and y the equation
    $ye^{y}=x$
can be solved for y only if x ≥ −⁠1/e⁠; yields y = W$_0$(x) if x ≥ 0 and the two values y = W$_0$(x) and y = W$_{−1}$(x) if −⁠1/e⁠ ≤ x < 0.
The Lambert W 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 y′(t) = a y(t − 1). 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.

## Terminology

The notation convention chosen here (with W$_0$ and W$_{−1}$) follows the canonical reference on the Lambert W function by Corless, Gonnet, Hare, Jeffrey and Knuth.
The name "product logarithm" can be understood as follows: since the inverse function of f(w) = e$^w$ is termed the logarithm, it makes sense to call the inverse "function" of the product 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 W$_0$(1).

## History

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 we$^w$.
The equation Lambert considered was
    $x=x^{m}+q.$
Euler transformed this equation into the form
    $x^{a}-x^{b}=(a-b)cx^{a+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
    $\ln x=cx^{a}.$
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—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 ⁠$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

There are countably many branches of the W function, denoted by W$_k$(z), for integer k; W$_0$(z) being the main (or principal) branch. W$_0$(z) is defined for all complex numbers z while W$_k$(z) with k ≠ 0 is defined for all non-zero z. With W$_0$(0) = 0 and limz→0 W$_k$(z) = −∞ for all k ≠ 0.
The branch point for the principal branch is at z = −⁠1/e⁠, with a branch cut that extends to −∞ along the negative real axis. This branch cut separates the principal branch from the two branches W$_{−1}$ and W$_1$. In all branches W$_k$ with k ≠ 0, there is a branch point at z = 0 and a branch cut along the entire negative real axis.
The functions W$_k$(z), k ∈ Z are all injective and their ranges are disjoint. The range of the entire multivalued function W is the complex plane. The image of the real axis is the union of the real axis and the quadratrix of Hippias, the parametric curve w = −t cot t + it.

### Inverse

The range plot above also delineates the regions in the complex plane where the simple inverse relationship ⁠$W(n,ze^{z})=z$⁠ is true. ⁠$f=ze^{z}$⁠ implies that there exists an ⁠$n$⁠ such that ⁠$z=W(n,f)=W(n,ze^{z})$⁠, where ⁠$n$⁠ depends upon the value of ⁠$z$⁠. The value of the integer ⁠$n$⁠ changes abruptly when ⁠$ze^{z}$⁠ is at the branch cut of ⁠$W(n,ze^{z})$⁠, which means that ⁠$ze^{z}$⁠ ≤ 0, except for ⁠$n=0$⁠ where it is ⁠$ze^{z}$⁠ ≤ −1/⁠$e$⁠.
Defining ⁠$z=x+iy$⁠, where ⁠$x$⁠ and ⁠$y$⁠ are real, and expressing ⁠$e^{z}$⁠ in polar coordinates, it is seen that
    ${\begin{aligned}ze^{z}&=(x+iy)e^{x}(\cos y+i\sin y)\\&=e^{x}(x\cos y-y\sin y)+ie^{x}(x\sin y+y\cos y)\\\end{aligned}}$
For $n\neq 0$, the branch cut for ⁠$W(n,ze^{z})$⁠ is the non-positive real axis, so that
    $x\sin y+y\cos y=0\Rightarrow x=-y/\tan(y),$
and
    $(x\cos y-y\sin y)e^{x}\leq 0.$
For $n=0$, the branch cut for ⁠$W[n,ze^{z}]$⁠ is the real axis with $-\infty <z\leq -1/e$, so that the inequality becomes
    $(x\cos y-y\sin y)e^{x}\leq -1/e.$
Inside the regions bounded by the above, there are no discontinuous changes in ⁠$W(n,ze^{z})$⁠, and those regions specify where the ⁠$W$⁠ function is simply invertible, i.e. ⁠$W(n,ze^{z})=z$⁠.

## Calculus
### Derivative

By implicit differentiation, one can show that all branches of W satisfy the differential equation
    $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:
    ${\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 e$^{W(z)}$ = ⁠z/W(z)⁠, gives the following equivalent formula:
    ${\frac {dW}{dz}}={\frac {1}{z+e^{W(z)}}}\quad {\text{for }}z\neq -{\frac {1}{e}}.$
At the origin we have
    $W'_{0}(0)=1.$
The n-th derivative of W is of the form:
    ${\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 P$_n$ is a polynomial function with coefficients defined in A042977. If and only if z is a root of P$_n$ then ze$^z$ is a root of the n-th derivative of W.
Taking the derivative of the n-th derivative of W yields:
    ${\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}}.$
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 = we$^w$:
    ${\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 W$_0$(e) = 1) is the identity
    $\int _{0}^{e}W_{0}(x)\,dx=e-1.$

## Asymptotic expansions

The Taylor series of W$_0$ around 0 can be found using the Lagrange inversion theorem and is given by
    $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 ⁠1/e⁠, as may be seen by the ratio test. The function defined by this series can be extended to a holomorphic function defined on all complex numbers with a branch cut along the interval (−∞, −⁠1/e⁠]; this holomorphic function defines the principal branch of the Lambert W function.
For large values of x, W$_0$ is asymptotic to
    ${\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 _{l=0}^{\infty }\sum _{m=1}^{\infty }{\frac {(-1)^{l}\left[{\begin{smallmatrix}l+m\\l+1\end{smallmatrix}}\right]}{m!}}L_{1}^{-l-m}L_{2}^{m},\end{aligned}}$
where L$_1$ = ln x, L$_2$ = ln ln x, and [$^{l+m}$ $_{l+1}$] is a non-negative Stirling number of the first kind. Keeping only the first two terms of the expansion,
    $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, with in this case L$_1$ = ln(−x) and L$_2$ = ln(−ln(−x)).

### Integer and complex powers

Integer powers of W$_0$ also admit simple Taylor (or Laurent) series expansions at zero:
    $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
    $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 W$_0$(x) / x:
    $\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},$
which holds for any r ∈ C and |x| < ⁠1/e⁠.

## Bounds and inequalities

A number of non-asymptotic bounds are known for the Lambert function.
Hoorfar and Hassani showed that the following bound holds for x ≥ e:
    $\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}}.$
They also showed the general bound
    $W_{0}(x)\leq \ln \left({\frac {x+y}{1+\ln(y)}}\right),$
for every $y>1/e$ and $x\geq -1/e$, with equality only for $x=y\ln(y)$. The bound allows many other bounds to be made, such as taking $y=x+1$ which gives the bound
    $W_{0}(x)\leq \ln \left({\frac {2x+1}{1+\ln(x+1)}}\right).$
In 2013 it was proven that the branch W$_{−1}$ can be bounded as follows:
    $-1-{\sqrt {2u}}-u<W_{-1}\left(-e^{-u-1}\right)<-1-{\sqrt {2u}}-{\tfrac {2}{3}}u\quad {\text{for }}u>0.$
Roberto Iacono and John P. Boyd enhanced the bounds as follows:
    $\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).$

## Identities

A few identities follow from the definition:
    ${\begin{aligned}W_{0}(xe^{x})&=x&{\text{for }}x&\geq -1,\\W_{-1}(xe^{x})&=x&{\text{for }}x&\leq -1.\end{aligned}}$
Note that, since f(x) = xe$^x$ is not injective, it does not always hold that W(f(x)) = x, much like with the inverse trigonometric functions. For fixed x < 0 and x ≠ −1, the equation xe$^x$ = ye$^y$ has two 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 = W$_i$(xe$^x$) is the other solution.
Some other identities:
    ${\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}}$
    $\ln W_{0}(x)=\ln x-W_{0}(x)\quad {\text{for }}x>0.$
    $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.$
    $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}}.$
    ${\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}}$
       (which can be extended to other n and x if the correct branch is chosen).
    $W(x)+W(y)=W\left(xy\left({\frac {1}{W(x)}}+{\frac {1}{W(y)}}\right)\right)\quad {\text{for }}x,y>0.$
Substituting −ln x in the definition:
    ${\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}}$
With Euler's iterated exponential h(x):
    ${\begin{aligned}h(x)&=e^{-W(-\ln x)}\\&={\frac {W(-\ln x)}{-\ln x}}\quad {\text{for }}x\neq 1.\end{aligned}}$

## Special values

The following are special values of the principal branch: $W_{0}\left(-{\frac {\pi }{2}}\right)={\frac {i\pi }{2}}$ $W_{0}\left(-{\frac {1}{e}}\right)=-1$ $W_{0}\left(2\ln 2\right)=\ln 2$ $W_{0}\left(x\ln x\right)=\ln x\quad \left(x\geqslant {\tfrac {1}{e}}\approx 0.36788\right)$ $W_{0}\left(x^{x+1}\ln x\right)=x\ln x\quad \left(x>0\right)$ $W_{0}(0)=0$
    $W_{0}(1)=\Omega =\left(\int _{-\infty }^{\infty }{\frac {dt}{\left(e^{t}-t\right)^{2}+\pi ^{2}}}\right)^{\!-1}\!\!\!\!-\,1\approx 0.56714329\quad$ (the omega constant)
$W_{0}(1)=e^{-W_{0}(1)}=\ln {\frac {1}{W_{0}(1)}}=-\ln W_{0}(1)$ $W_{0}(e)=1$ $W_{0}\left(e^{1+e}\right)=e$ $W_{0}\left({\frac {\sqrt {e}}{2}}\right)={\frac {1}{2}}$ $W_{0}\left({\frac {\sqrt[{n}]{e}}{n}}\right)={\frac {1}{n}}$ $W_{0}(-1)\approx -0.31813+1.33723i$
Special values of the branch W$_{−1}$: $W_{-1}\left(-{\frac {\ln 2}{2}}\right)=-\ln 4$

## Representations

The principal branch of the Lambert function can be represented by a proper integral, due to Poisson:
    $-{\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:
    $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:
    $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 }}}}}}}}}}}}}}}}.$
Also, if |W$_0$(x)| < 1:
    $W_{0}(x)={\cfrac {x}{\exp {\cfrac {x}{\exp {\cfrac {x}{\ddots }}}}}}.$
In turn, if |W$_0$(x)| > 1, then
    $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:
    ${\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>0\end{aligned}}$
where $\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 = W$_0$(x), which gives
    ${\begin{aligned}x&=ue^{u},\\[5pt]{\frac {dx}{du}}&=(u+1)e^{u}.\end{aligned}}$
Thus
    ${\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, $u=x^{\frac {1}{N}}$, $t=W_{0}(u)$, and $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:
    ${\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

$\int {\frac {W(x)}{x}}\,dx\;=\;{\frac {W(x)^{2}}{2}}+W(x)+C$
Introduce substitution variable $u=W(x)\rightarrow ue^{u}=x\;\;\;\;{\frac {d}{du}}ue^{u}=(u+1)e^{u}$
    $\int {\frac {W(x)}{x}}\,dx\;=\;\int {\frac {u}{ue^{u}}}(u+1)e^{u}\,du$
    $\int {\frac {W(x)}{x}}\,dx\;=\;\int {\frac {\cancel {\color {OliveGreen}{u}}}{{\cancel {\color {OliveGreen}{u}}}{\cancel {\color {BrickRed}{e^{u}}}}}}\left(u+1\right){\cancel {\color {BrickRed}{e^{u}}}}\,du$
    $\int {\frac {W(x)}{x}}\,dx\;=\;\int (u+1)\,du$
    $\int {\frac {W(x)}{x}}\,dx\;=\;{\frac {u^{2}}{2}}+u+C$
       $u=W(x)$
    $\int {\frac {W(x)}{x}}\,dx\;=\;{\frac {W(x)^{2}}{2}}+W(x)+C$
$W(x)e^{W(x)}=x\rightarrow {\frac {W(x)}{x}}=e^{-W(x)}$
$\int {\frac {W(x)}{x}}\,dx\;=\;\int e^{-W(x)}\,dx$
       $u=W(x)\rightarrow ue^{u}=x\;\;\;\;{\frac {d}{\,du}}ue^{u}=\left(u+1\right)e^{u}$
$\int {\frac {W(x)}{x}}\,dx\;=\;\int e^{-u}(u+1)e^{u}\,du$
$\int {\frac {W(x)}{x}}\,dx\;=\;\int {\cancel {\color {OliveGreen}{e^{-u}}}}\left(u+1\right){\cancel {\color {OliveGreen}{e^{u}}}}\,du$
$\int {\frac {W(x)}{x}}\,dx\;=\;\int (u+1)\,du$
$\int {\frac {W(x)}{x}}\,dx\;=\;{\frac {u^{2}}{2}}+u+C$
       $u=W(x)$
$\int {\frac {W(x)}{x}}\,dx\;=\;{\frac {W(x)^{2}}{2}}+W(x)+C$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(Ae^{Bx}\right)^{2}}{2B}}+{\frac {W\left(Ae^{Bx}\right)}{B}}+C$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;\int W\left(Ae^{Bx}\right)\,dx$
       $u=Bx\rightarrow {\frac {u}{B}}=x\;\;\;\;{\frac {d}{du}}{\frac {u}{B}}={\frac {1}{B}}$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;\int W\left(Ae^{u}\right){\frac {1}{B}}du$
       $v=e^{u}\rightarrow \ln \left(v\right)=u\;\;\;\;{\frac {d}{dv}}\ln \left(v\right)={\frac {1}{v}}$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {1}{B}}\int {\frac {W\left(Av\right)}{v}}dv$
       $w=Av\rightarrow {\frac {w}{A}}=v\;\;\;\;{\frac {d}{dw}}{\frac {w}{A}}={\frac {1}{A}}$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {1}{B}}\int {\frac {{\cancel {\color {OliveGreen}{A}}}W(w)}{w}}{\cancel {\color {OliveGreen}{\frac {1}{A}}}}dw$
       $t=W\left(w\right)\rightarrow te^{t}=w\;\;\;\;{\frac {d}{dt}}te^{t}=\left(t+1\right)e^{t}$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {1}{B}}\int {\frac {t}{te^{t}}}\left(t+1\right)e^{t}dt$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {1}{B}}\int {\frac {\cancel {\color {OliveGreen}{t}}}{{\cancel {\color {OliveGreen}{t}}}{\cancel {\color {BrickRed}{e^{t}}}}}}\left(t+1\right){\cancel {\color {BrickRed}{e^{t}}}}dt$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {1}{B}}\int (t+1)dt$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {t^{2}}{2B}}+{\frac {t}{B}}+C$
       $t=W\left(w\right)$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(w\right)^{2}}{2B}}+{\frac {W\left(w\right)}{B}}+C$
       $w=Av$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(Av\right)^{2}}{2B}}+{\frac {W\left(Av\right)}{B}}+C$
       $v=e^{u}$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(Ae^{u}\right)^{2}}{2B}}+{\frac {W\left(Ae^{u}\right)}{B}}+C$
       $u=Bx$
$\int W\left(Ae^{Bx}\right)\,dx\;=\;{\frac {W\left(Ae^{Bx}\right)^{2}}{2B}}+{\frac {W\left(Ae^{Bx}\right)}{B}}+C$
$\int {\frac {W(x)}{x^{2}}}\,dx\;=\;\operatorname {Ei} \left(-W(x)\right)-e^{-W(x)}+C$
Introduce substitution variable $u=W(x)$, which gives us $ue^{u}=x$ and ${\frac {d}{du}}ue^{u}=\left(u+1\right)e^{u}$
${\begin{aligned}\int {\frac {W(x)}{x^{2}}}\,dx\;&=\;\int {\frac {u}{\left(ue^{u}\right)^{2}}}\left(u+1\right)e^{u}du\\&=\;\int {\frac {u+1}{ue^{u}}}du\\&=\;\int {\frac {u}{ue^{u}}}du\;+\;\int {\frac {1}{ue^{u}}}du\\&=\;\int e^{-u}du\;+\;\int {\frac {e^{-u}}{u}}du\end{aligned}}$
       $v=-u\rightarrow -v=u\;\;\;\;{\frac {d}{dv}}-v=-1$
$\int {\frac {W(x)}{x^{2}}}\,dx\;=\;\int e^{v}\left(-1\right)dv\;+\;\int {\frac {e^{-u}}{u}}du$
$\int {\frac {W(x)}{x^{2}}}\,dx\;=\;-e^{v}+\operatorname {Ei} \left(-u\right)+C$
       $v=-u$
$\int {\frac {W(x)}{x^{2}}}\,dx\;=\;-e^{-u}+\operatorname {Ei} \left(-u\right)+C$
       $u=W(x)$
${\begin{aligned}\int {\frac {W(x)}{x^{2}}}\,dx\;&=\;-e^{-W(x)}+\operatorname {Ei} \left(-W(x)\right)+C\\&=\;\operatorname {Ei} \left(-W(x)\right)-e^{-W(x)}+C\end{aligned}}$

## 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 ze$^z$ = w and then to solve for z using the W function.
For example, the equation
    $3^{x}=2x+2$
(where x is an unknown real number) can be solved by rewriting it as
    ${\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:
    $(\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)$
and thus:
    $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$
Generally, the solution to
    $x=a+b\,e^{cx}$
is:
    $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.

### Inviscid flows

Applying the unusual accelerating traveling-wave Ansatz in the form of $\rho (\eta )=\rho {\bigx-{\frac {at^{2}}{2}}{\big )}$ (where $\rho$, $\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:
    $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: ${\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 $Q_{i}$ 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.

### 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, k{\textstyle k}, and solute concentration in the melt, C$_L${\textstyle C_{L}}, from the Scheil equation:
    ${\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

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

### 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):
    $Y={\frac {X}{1-e^{X}}}$
can be solved by means of the two real branches W$_0$ and W$_{−1}$:
    $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
    $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
    $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 $\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
    $\ln K={\frac {a}{T}}+b+c\ln T$
for some constants a, b, and c. When c (equal to ⁠ΔC$_p$/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.
    ${\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 $\nu _{\max }/T=\alpha =\mathrm {const}$. With $x=h\nu _{\max }/k_{\mathrm {B} }T$ and $d\rho _{T}\left(x\right)/dx=0$, where $\rho _{T}$ is the spectral energy energy density, one finds $e^{-x}=1-{\frac {x}{D}}$, where $D$ is the number of degrees of freedom for spatial translation. The solution $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 $x^{2}+(1-\varepsilon ^{2})y^{2}=\varepsilon ^{2}$ centered at $(0,0)$ is parameterized by eccentricity $\varepsilon$. The orthogonal trajectories of this family are given by the differential equation $\left({\frac {1}{y}}+y\right)dy=\left({\frac {1}{x}}-x\right)dx$ whose general solution is the family $y^{2}=$$W_{0}(x^{2}\exp(-2C-x^{2}))$.

## Generalizations

The standard Lambert W function expresses exact solutions to transcendental algebraic equations (in x) of the form:
where a$_0$, c and r are real constants. The solution is $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 (1) is replaced by a quadratic polynomial in x: $e^{-cx}=a_{0}\left(x-r_{1}\right)\left(x-r_{2}\right),$ 2 where r$_1$ and r$_2$ 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 r$_i$ and a$_0$ are parameters of that function. In this respect, the generalization resembles the hypergeometric function and the Meijer G function but it belongs to a different class of functions. When r$_1$ = r$_2$, both sides of (2) can be factored and reduced to (1) and thus the solution reduces to that of the standard W function. Equation (2) expresses the equation governing the dilaton field, from which is derived the metric of the R = T or lineal 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 (1) is replaced by a ratio of infinite order polynomials in x: $e^{-cx}=a_{0}{\frac {\displaystyle \prod _{i=1}^{\infty }(x-r_{i})}{\displaystyle \prod _{i=1}^{\infty }(x-s_{i})}}$ 3 where r$_i$ and s$_i$ are distinct real constants and x is a function of the eigenenergy and the internuclear distance R. Equation (3) with its specialized cases expressed in (1) and (2) is related to a large class of delay differential equations. G. H. Hardy's notion of a "false derivative" provides exact multiple roots to special cases of (3).
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.

## Plots

* Plots of the Lambert W function on the complex plane
* z = Re(W$_0$(x + iy))
* z = Im(W$_0$(x + iy))
* z = |W$_0$(x + iy)|
* Superimposition of the previous three plots

## Numerical evaluation

The W function may be approximated using Newton's method, with successive approximations to w = W(z) (so z = we$^w$) being
    $w_{j+1}=w_{j}-{\frac {w_{j}e^{w_{j}}-z}{e^{w_{j}}+w_{j}e^{w_{j}}}}.$
The W function may also be approximated using Halley's method,
    $w_{j+1}=w_{j}-{\frac {w_{j}e^{w_{j}}-z}{e^{w_{j}}\left(w_{j}+1\right)-{\dfrac {\left(w_{j}+2\right)\left(w_{j}e^{w_{j}}-z\right)}{2w_{j}+2}}}}$
given in Corless et al. to compute W.
For real $x\geq -1/e$, it may be approximated by the quadratic-rate recursive formula of R. Iacono and J.P. Boyd:
    $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 $w_{0}(x)$,
* For the principal branch $W_{0}:$
** if $x\in (e,\infty )$: $w_{0}(x)=\log(x)-\log(\log(x)),$
** if $x\in (0,e):$ $w_{0}(x)=x/e,$
** if $x\in (-1/e,0):$ $w_{0}(x)={\frac {ex\log(1+{\sqrt {1+ex}})}{1+ex+{\sqrt {1+ex}}}},$
* For the branch $W_{-1}:$
** if $x\in (-1/4,0):$ $w_{0}(x)=\log(-x)-\log(-\log(-x)),$
** if $x\in (-1/e,-1/4]:$ $w_{0}(x)=-1-{\sqrt {2}}{\sqrt {1+ex}},$
one can determine the maximum number of iteration steps in advance for any precision:
* if $x\in (e,\infty )$ (Theorem 2.4): $0<W_{0}(x)-w_{n}(x)<\left(\log(1+1/e)\right)^{2^{n}},$
* if $x\in (0,e)$ (Theorem 2.9): $0<W_{0}(x)-w_{n}(x)<{\frac {\left(1-1/e\right)^{2^{n}-1}}{5}},$
* if $x\in (-1/e,0):$
** for the principal branch $W_{0}$ (Theorem 2.17): $0<w_{n}(x)-W_{0}(x)<\left(1/10\right)^{2^{n}},$
** for the branch $W_{-1}$(Theorem 2.23): $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 rational functions on transformed variables: $W_{0}(z)={\begin{cases}X_{k}(x),&(z_{k-1}<=z<z_{k},\quad k=1,2,\ldots ,17),\\U_{k}(u),&(z_{k-1}<=z<z_{k},\quad k=18,19),\end{cases}}$ $W_{-1}(z)={\begin{cases}Y_{k}(y),&(z_{k-1}<=z<z_{k},\quad k=-1,-2,\ldots ,-7),\\V_{k}(u),&(z_{k-1}<=z<z_{k},\quad k=-8,-9,-10),\end{cases}}$ where x, u, y and v are transformations of z:
    $x={\sqrt {z+1/e}},\quad u=\ln {z},\quad y=-z/(x+1/{\sqrt {e}}),\quad v=\ln(-z)$.
Here $X_{k}(x)$, $U_{k}(u)$, $Y_{k}(y)$, and $V_{k}(v)$ are rational functions whose coefficients for different k-values are listed in the referenced paper together with the $z_{k}$ 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/e\leq z\leq 2.0082178115844727$, $W_{0}(z)$ can be approximated to 24 bits of accuracy on 64-bit floating point values as $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 $P_{i}$ and $Q_{i}$ are given in the table below.
Coefficients :
| $i$ | $P_{i}$ | $Q_{i}$ |
| 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) |
| C/C++ | lambert_w0, lambert_wm1, lambert_w0_prime, and lambert_wm1_prime | Boost C++ libraries |
| C/C++ | LambertW | LambertW-function |
| GP | lambertw | |
| Julia | lambertw | LambertW |
| Maple | LambertW | |
| Mathematica | ProductLog (with LambertW as a silent alias) | |
| Matlab | lambertw | |
| Maxima | lambert_w | |
| Octave | lambertw | specfun |
| PARI | glambertW, lambertWC, glambertW_i, mplambertW, lambertW | |
| Perl | LambertW | ntheory |
| Python | lambertw | scipy |
| R | lambertW0 and lambertWm1 | lamW |
| Rust | lambert_w0 and lambert_wm1 | lambert_w |