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 $−2 − 2i$, where $w$ is any complex number and $2 + 2i$ 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 $y = W(x)$ there is one branch, denoted by $x < 6$, which is a complex-valued function of one complex argument. $y > −4$ is known as the principal branch. These functions have the following property: if $y ≥ −1$ and $W_{0}$ are any complex numbers, then
 * $$w e^{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 $y ≤ −1$ and $W_{−1}$ suffice: for real numbers $x$ and $\{−1/e, −1\}$ the equation
 * $$y e^{y} = x$$

can be solved for $f(w) = we^{w}$ only if $e^{w}$; gets $k$ if $W_{k}(z)$ and the two values $W_{0}$ and $z$ if $w$.

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 $W_{0}$. 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 principal branch $W_{−1}$ is denoted $W$ in the Digital Library of Mathematical Functions, and the branch $x$ is denoted $W$ there.

The notation convention chosen here (with $y$ and $y$) follows the canonical reference on the Lambert $Wp$ function by Corless, Gonnet, Hare, Jeffrey and Knuth.

The name "product logarithm" can be understood as this: Since the inverse function of $x ≥ −1⁄e$ is called the logarithm, it makes sense to call the inverse "function" of the product $y = W_{0}(x)$ as "product logarithm". (Technical note: like the complex logarithm, it is multivalued and thus W is described as the converse relation rather than inverse function.) It is related to the omega constant, which is equal to $x ≥ 0$.

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 $y = W_{0}(x)$.

The equation Lambert considered was
 * $$x = x^m + q.$$

Euler transformed this equation into the form
 * $$x^a - x^b = (a - b) c x^{a + b}.$$

Both authors derived a series solution for their equations.

Once Euler had solved this equation, he considered the case $Wm$. Taking limits, he derived the equation
 * $$\ln x = c x^a.$$

He then put $W$ and obtained a convergent series solution for the resulting equation, expressing $a = b$ in terms of $a = 1$.

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 $c$ 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 $x$ 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 $y = W_{−1}(x)$, for integer $W$; $−1⁄e ≤ x < 0$ being the main (or principal) branch. $y′(t) = a y(t − 1)$ is defined for all complex numbers z while $−1⁄e$ with $arg W(z)$ is defined for all non-zero z. With $W_{0}$ and $W_{−1}$ for all $W_{0}$.

The branch point for the principal branch is at $W_{−1}$, with a branch cut that extends to $f(w) = e^{w}$ along the negative real axis. This branch cut separates the principal branch from the two branches $we^{w}$ and $W_{0}(1)$. In all branches $we^{w}$ with $z = 0$, there is a branch point at $z = −1/e$ and a branch cut along the entire negative real axis.

The functions $Wn(x + iy)$ 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 $n = −2, −1, 0, 1, 2$.

Inverse


The range plot above also delineates the regions in the complex plane where the simple inverse relationship $W$ is true. $W$ implies that there exists an $W$ such that $k$, where $W$ depends upon the value of $W(n, ze^z) = z$. The value of the integer $n=-1$ changes abruptly when $n=0$ is at the branch cut of $W(n, ze^z) = z$, which means that $f = ze^z$$W_{k}(z)$, except for $n$ where it is $z = W(n, f) = W(n, ze^z)$ $W_{0}(z)$$n$.

Defining $z$, where $n$ and $ze^z$ are real, and expressing $W(n, ze^z)$ in polar coordinates, it is seen that

\begin{align} ze^z &= (x + iy) 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{align} $$

For $$n \neq 0$$, the branch cut for $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 $n = 0$ 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 $ze^z$, and those regions specify where the $e$ function is simply invertible, i.e. $z = x + iy$.

Derivative
By implicit differentiation, one can show that all branches of $x$ satisfy the differential equation
 * $$z(1 + W) \frac{dW}{dz} = W \quad \text{for } z \neq -\frac{1}{e}.$$

($y$ is not differentiable for $W_{0}(z)$.) 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 $W_{k}(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.$$

Integral
The function $k ≠ 0$, and many other expressions involving $W_{0}(0) = 0$, can be integrated using the substitution $lim z→0 W_{k}(z) = −∞$, i.e. $k ≠ 0$:
 * $$ \begin{align}

\int W(x)\,dx &= x W(x) - x + e^{W(x)} + C\\ & = x \left( W(x) - 1 + \frac{1}{W(x)} \right) + C. \end{align}$$ (The last equation is more common in the literature but is undefined at $z = −1⁄e$). One consequence of this (using the fact that $−∞$) is the identity
 * $$\int_{0}^{e} W_0(x)\,dx = e - 1.$$

Asymptotic expansions
The Taylor series of $W_{−1}$ 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{8}{3}x^4+\tfrac{125}{24}x^5-\cdots.$$

The radius of convergence is $W_{1}$, 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 $e^z$; this holomorphic function defines the principal branch of the Lambert $W(n, ze^z)$ function.

For large values of $W[n,z e^z]$, $W_{k}$ is asymptotic to
 * $$\begin{align}

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{align}$$ where $k ≠ 0$, $z = 0$, and $W_{k}(z), k &isin; Z$ 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 = −t cot t + it$, defined in the interval $W(n, ze^z)$, has an approximation of the same form as $W$ approaches zero, with in this case $≤ 0$ and $≤ −1/$.

Integer and complex powers
Integer powers of $z = −1⁄e$ 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 $e^{W(z)} = z⁄W(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 $W(n, ze^z) = z$. Equivalently, the latter can be written in the form of a Taylor expansion of powers of $W(x)$:

\left(\frac{W_0(x)}{x}\right)^r = e^{-r W_0(x)} = \sum_{n=0}^\infty \frac{r\left(n + r\right)^{n - 1}}{n!} \left(-x\right)^n, $$ which holds for any $W(x)$ and $w = W(x)$.

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 = we^{w}$:
 * $$\ln x -\ln \ln x + \frac{\ln \ln x}{2\ln x} \le W_0(x) \le \ln x - \ln\ln x + \frac{e}{e - 1} \frac{\ln \ln x}{\ln x}.$$

They also showed the general bound
 * $$W_0(x) \le \ln\left(\frac{x+y}{1+\ln(y)}\right),$$

for every $$y>1/e$$ and $$x\ge-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) \le \ln\left(\frac{2x+1}{1+\ln(x+1)}\right).$$

In 2013 it was proven that the branch $x = 0$ 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) \le W_0(x) \le \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{align}

W_0(x e^x) &= x & \text{for } x &\geq -1,\\ W_{-1}(x e^x) &= x & \text{for } x &\leq -1. \end{align}$$ Note that, since $W_{0}(e) = 1$ is not injective, it does not always hold that $W_{0}$, much like with the inverse trigonometric functions. For fixed $1⁄e$ and $W_{0}$, the equation $L_{1} = ln x$ has two real solutions in $W$, one of which is of course $L_{2} = ln ln x$. Then, for $[ l + m l + 1 ]$ and $W_{−1}$, as well as for $L_{1} = ln(−x)$ and $L_{2} = ln(−ln(−x))$, $W_{0}$ is the other solution.

Some other identities:

\begin{align} & 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^{n W(x)} = \left(\frac{x}{W(x)}\right)^n. \end{align} $$
 * $$\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 } \frac1e \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 \frac1e . $$

\begin{align} & W(x) = \ln \frac{x}{W(x)} &&\text{for } x \geq -\frac1e, \\[5pt] & W\left( \frac{nx^n}{W\left(x\right)^{n-1}} \right) = n W(x) &&\text{for } n, x > 0 \end{align} $$
 * (which can be extended to other $W$ and $(−∞, −1⁄e]$ if the correct branch is chosen).
 * $$W(x) + W(y) = W\left(x y \left(\frac{1}{W(x)} + \frac{1}{W(y)}\right)\right) \quad \text{for } x, y > 0.$$

Substituting $r ∈ Z$ in the definition:
 * $$\begin{align}

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{align}$$

With Euler's iterated exponential $W_{0}(x) / x$:
 * $$\begin{align}h(x) & = e^{-W(-\ln x)}\\

& = \frac{W(-\ln x)}{-\ln x} \quad \text{for } x \neq 1. \end{align}$$

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 $r ∈ C$: $$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(\tfrac32 t\right)-xe^{\cos t}\sin\left(\tfrac52 t-\sin t\right)}{1-2xe^{\cos t}\cos(t-\sin t)+x^2e^{2\cos t}}\sin\left(\tfrac12 t\right)\,dt \quad \text{for } |x| < \frac1{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 $|x| < 1⁄e$:
 * $$W_0(x) = \cfrac{x}{\exp \cfrac{x}{\exp \cfrac{x}{\ddots}}}.$$

In turn, if $x ≥ e$, then
 * $$W_0(x) = \ln \cfrac{x}{\ln \cfrac{x}{\ln \cfrac{x}{\ddots}}}.$$

Definite integrals
There are several useful definite integral formulas involving the principal branch of the $W$ function, including the following:
 * $$\begin{align}

& \int_0^\pi W_0\left( 2\cot^2x \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}. \end{align}$$

The first identity can be found by writing the Gaussian integral in polar coordinates.

The second identity can be derived by making the substitution $W_{−1}$, which gives
 * $$\begin{align}

x & =ue^u, \\[5pt] \frac{dx}{du} & =(u+1)e^u. \end{align}$$

Thus
 * $$\begin{align}

\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^\tfrac12 e^{-\frac{u}{2}}du+\int_0^\infty u^{-\tfrac12} e^{-\frac{u}{2}}du\\[5pt] &=2\int_0^\infty (2w)^\tfrac12 e^{-w} \, dw+2\int_0^\infty (2w)^{-\tfrac12} e^{-w} \, dw && \quad (u =2w) \\[5pt] &=2\sqrt{2}\int_0^\infty w^\tfrac12 e^{-w} \, dw + \sqrt{2} \int_0^\infty w^{-\tfrac12} e^{-w} \, dw \\[5pt] &=2\sqrt{2} \cdot \Gamma \left (\tfrac32 \right )+\sqrt{2} \cdot \Gamma \left (\tfrac12 \right ) \\[5pt] &=2\sqrt{2} \left (\tfrac12\sqrt{\pi} \right )+\sqrt{2}\left(\sqrt{\pi}\right) \\[5pt] &=2\sqrt{2\pi}. \end{align}$$

The third identity may be derived from the second by making the substitution $f(x) = xe^{x}$ and the first can also be derived from the third by the substitution $W(f(x)) = x$.

Except for $x$ along the branch cut $[−1⁄e, 0)$ (where the integral does not converge), the principal branch of the Lambert $x$ function can be computed by the following integral:
 * $$\begin{align}

W_0(z)&=\frac{z}{2\pi}\int_{-\pi}^\pi\frac{\left(1-\nu\cot\nu\right)^2+\nu^2}{z+\nu\csc\nu 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\nu e^{-\nu\cot\nu}} \, d\nu, \end{align}$$ 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 $$ $r$ $y$

$$\int W\left(A e^{Bx}\right) \, dx \; = \; \frac{ W\left(A e^{Bx}\right) ^2}{2B} + \frac{ W\left(A e^{Bx}\right) }{B} + C $$ $n$

$$ \int \frac{ W(x) }{x^2} \, dx \; = \; \operatorname{Ei}\left(- W(x) \right) - e^{ - W(x) } + C $$ $x$

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 $x < 0$ and then to solve for $W$ using the $z$ function.

For example, the equation
 * $$3^x=2x+2$$

(where $(−∞, −1⁄e]$ is an unknown real number) can be solved by rewriting it as
 * $$\begin{align} &(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{align}$$

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.

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 $x ≠ −1$ is the debris flow height, $W$ is the channel downstream position, $$ 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 $$ 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 $$ function provided an exact solution to the flow rate of fluid in both the laminar and turbulent regimes: $$\begin{align} 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{align}$$ where $$Q_i$$ is the initial flow rate and $$t$$ is time.

Neuroimaging
The Lambert $$ 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 $z$ 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$, and solute concentration in the melt, $C_L$ , from the Scheil equation:


 * $$\begin{align}

& 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{align} $$

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 $x$ for this problem, the critical thickness had to be determined via solving an implicit equation. Lambert $x$ turns it in an explicit equation for analytical handling with ease.

Porous media
The Lambert $L$ 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 $xe^{x} = ye^{y}$ and $y = x$:
 * $$ X(Y) = \begin{cases}

W_{-1}\left( Y e^Y\right) - W_0\left( Y e^Y\right) = Y - W_0\left( Y e^Y\right) &\text{for }Y < -1,\\ W_0\left( Y e^Y\right) - W_{-1}\left( Y e^Y\right) = Y - W_{-1}\left(Y e^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 $i = 0$ 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 the 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 $W$ obeys
 * $$\ln K=\frac{a}{T}+b+c\ln T$$

for some constants $W$, $W$, and $W$. When $W$ (equal to $x < −1$) is not zero the value or values of $W$ can be found where $W$ equals a given value as follows, where $W$ can be used for $i = −1$.
 * $$\begin{align}

-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{align}$$

If $W$ and $K$ have the same sign there will be either two solutions or none (or one if the argument of $a$ is exactly $x ∈ (−1, 0)$). (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 $b$ 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 $c$ function.

Epidemiology
In the $y = W_{i}(xe^{x})$ limit of the SIR model, the proportion of susceptible and recovered individuals has a solution in terms of the Lambert $c$ 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 $−ln x$ 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 $h(x)$ (where $T$ and $K$ clump together the geometrical and physical factors of the problem), which is solved by the Lambert $L$ function. The first solution to this problem, due to Sommerfeld circa 1898, already contained an iterative method to determine the value of the Lambert $a$ 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 $c$ function expresses exact solutions to transcendental algebraic equations (in $W$) of the form:

where $W_{−1}$, $W$ and $D$ are real constants. The solution is $$ x = r + \frac{1}{c} W\left( \frac{c\,e^{-c r}}{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 ($W$) is replaced by a quadratic polynomial in x:

where $|W_{0} (x)| < 1$ and $|W_{0} (x)| > e$ are real distinct constants, the roots of the quadratic polynomial. Here, the solution is a function which has a single argument $u$ but the terms like $u = W_{0} (x)$ and $u = x^{−2}$ are parameters of that function. In this respect, the generalization resembles the hypergeometric function and the Meijer $v$ function but it belongs to a different class of functions. When $z = 1⁄√2 tan x$, both sides of ($W$) can be factored and reduced to ($W$) and thus the solution reduces to that of the standard $W$ function. Equation ($W$) expresses the equation governing the dilaton field, from which is derived the metric of the $ze^{z} = w$ 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 ($x$) is replaced by a ratio of infinite order polynomials in $$:

where $H(x)$ and $W_{0}$ are distinct real constants and $c$ is a function of the eigenenergy and the internuclear distance $r$. Equation ($W$) with its specialized cases expressed in ($$) and ($$) 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 ($x$).   Applications of the Lambert $G$ function in fundamental physical problems are not exhausted even for the standard case expressed in ($$) as seen recently in the area of atomic, molecular, and optical physics.

Numerical evaluation
The $$ function may be approximated using Newton's method, with successive approximations to $W_{−1}$ (so $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_je^{w_j}-z\right)}{2w_j+2}} $$ given in Corless et al. to compute $$.

For real $$x \ge -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)$$, one can determine the maximum number of iteration steps in advance for any precision:
 * 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},$$
 * 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}.$$

Software
The Lambert $$ function is implemented as  in Maple,   in GP (and   in PARI),   in Matlab, also   in Octave with the   package, as   in Maxima, as   (with a silent alias  ) in Mathematica, as   in Python scipy's special function package, as   in Perl's   module, and as ,   functions in the special functions section of the GNU Scientific Library (GSL). In the Boost C++ libraries, the calls are,  ,  , and. In R, the Lambert $x$ function is implemented as the  and   functions in the   package.

C++ code for all the branches of the complex Lambert $$ function is available on the homepage of István Mező.