LambertW - Maple Programming Help

Home : Support : Online Help : Mathematics : Special Functions : LambertW

LambertW

The Lambert W function

 Calling Sequence LambertW(x) LambertW(k, x)

Parameters

 x - algebraic expression k - algebraic expression, understood to be an integer

Description

 • The LambertW function satisfies

$\mathrm{LambertW}\left(x\right){ⅇ}^{\mathrm{LambertW}\left(x\right)}=x$

 • As the equation $y{ⅇ}^{y}=x$ has an infinite number of solutions y for each (non-zero) value of x, LambertW has an infinite number of branches. Exactly one of these branches is analytic at 0. In Maple this branch is referred to as the principal branch of LambertW, and is denoted by LambertW(x).  The other branches all have a branch point at 0, and these branches are denoted in Maple by LambertW(k, x), where k is any non-zero integer.  (The principal branch can also be referred to as LambertW(0, x).)
 • The principal branch and the pair of branches LambertW(-1, x) and LambertW(1, x) share an order 2 branch point at -exp(-1).  The branch cut dividing these branches is the subset of the real line from $-\mathrm{\infty }$ to $-{ⅇ}^{-1}$, and the values of the branches of LambertW on this branch cut are assigned using the rule of counter-clockwise continuity around the branch point. This means that LambertW(x) is real-valued for x in the range $-{ⅇ}^{-1}..\mathrm{\infty }$, while the image of $-\mathrm{\infty }..-{ⅇ}^{-1}$ under LambertW(x) is the curve $-y\mathrm{cot}\left(y\right)+Iy$, for y in $0..\mathrm{\pi }$.
 Similarly, the branch corresponding to -1, LambertW(-1, x), is real-valued on the interval $-{ⅇ}^{-1}..0$, while the image of $-\mathrm{\infty }..-{ⅇ}^{-1}$ under this branch is the curve $-y\mathrm{cot}\left(y\right)+Iy$, for y in -Pi .. 0.
 • For all the branches other than the principal branch, the branch cut dividing them is the negative real axis.  The branches are numbered up and down from the real axis (this is very similar to the way the branches of the logarithm are indexed by the multiple of $2I\mathrm{\pi }$ which must be subtracted from the imaginary part to recover the principal branch).  Again, the values of the branches of LambertW along the branch cut are determined by the rule of counter-clockwise continuity around the branch point at 0.  Thus, the image of the negative real axis under the branch LambertW(k, x) is the curve $-y\mathrm{cot}\left(y\right)+Iy$, for y in $2k\mathrm{\pi }..\left(2k+1\right)\mathrm{\pi }$ if $0 and y in $\left(2k+1\right)\mathrm{\pi }..\left(2k+2\right)\mathrm{\pi }$ if $k<-1$.  These curves, therefore, bound the ranges of the branches of LambertW, and in each case, the upper boundary of the region is included in the range of the corresponding branch.
 • The asymptotic behavior of LambertW at complex infinity and at 0 (for the non-principal branches) is given by

$\mathrm{LambertW}\left(k,x\right)\sim \mathrm{log}\left(k,x\right)-\mathrm{log}\left(\mathrm{log}\left(k,x\right)\right)+\sum _{m=0}^{\mathrm{\infty }}\sum _{n=0}^{\mathrm{\infty }}c\left(m,n\right)\frac{\mathrm{log}{\left(\mathrm{log}\left(k,x\right)\right)}^{m+1}}{\mathrm{log}{\left(k,x\right)}^{m+n+1}}$

 where $\mathrm{log}\left(x\right)$ denotes the principal branch of the logarithm, $\mathrm{log}\left(k,x\right)=\mathrm{log}\left(x\right)+2Ik\mathrm{\pi }$ and the $c\left(m,n\right)$ are constants independent of k. The expansion for LambertW(-1, x) is not valid for x tending to 0 along the negative real axis (the effect of the branch point at -exp(-1) must be considered), but holds otherwise.
 • The LambertW function is closely related to the tree generating function $T\left(x\right)$ popularized in the analysis of algorithms discipline.  When ${T}_{n}$ counts the number of distinct oriented trees with n labeled vertices and $T\left(x\right)=\sum _{n=1}^{\mathrm{\infty }}\frac{{T}_{n}{x}^{n}}{n!}$, then $T\left(x\right)=-\mathrm{LambertW}\left(-x\right)$.

Examples

 > $\mathrm{LambertW}\left(0\right)$
 ${0}$ (1)
 > $\mathrm{LambertW}\left(-\mathrm{exp}\left(-1\right)\right)$
 ${-1}$ (2)
 > $\mathrm{LambertW}\left(1.5+2.5I\right)$
 ${0.9698925542}{+}{0.5301457549}{}{I}$ (3)
 > $\mathrm{LambertW}\left(-1,-0.1\right)$
 ${-3.577152064}$ (4)
 > $\mathrm{LambertW}\left(1,-\frac{5}{2}\mathrm{\pi }\right)$
 $\frac{{5}{}{I}}{{2}}{}{\mathrm{\pi }}$ (5)
 > $\mathrm{LambertW}\left(100,\mathrm{\pi }+\mathrm{exp}\left(1\right)I\right)$
 ${\mathrm{LambertW}}{}\left({100}{,}{\mathrm{\pi }}{+}{I}{}{ⅇ}\right)$ (6)
 > $\mathrm{evalf}\left(\right)$
 ${-5.017543738}{+}{627.4530224}{}{I}$ (7)

The alias command can be used to shorten the name, if desired

 > $\mathrm{alias}\left(W=\mathrm{LambertW}\right)$
 ${W}$ (8)
 > $\mathrm{solve}\left(3x<\mathrm{exp}\left(x\right),x\right)$
 $\left({-}{\mathrm{\infty }}{,}{-}{W}{}\left({-}\frac{{1}}{{3}}\right)\right){,}\left({-}{W}{}\left({-1}{,}{-}\frac{{1}}{{3}}\right){,}{\mathrm{\infty }}\right)$ (9)
 > $\mathrm{diff}\left(W\left(x\right),x\right)$
 $\frac{{W}{}\left({x}\right)}{\left({1}{+}{W}{}\left({x}\right)\right){}{x}}$ (10)
 > $\mathrm{int}\left(\mathrm{cos}\left(W\left(k,x\right)\right),x\right)$
 $\frac{\left(\frac{{1}}{{2}}{+}\frac{{W}{}\left({k}{,}{x}\right)}{{2}}\right){}{x}{}{\mathrm{cos}}{}\left({W}{}\left({k}{,}{x}\right)\right)}{{W}{}\left({k}{,}{x}\right)}{+}\frac{{x}{}{\mathrm{sin}}{}\left({W}{}\left({k}{,}{x}\right)\right)}{{2}}$ (11)

References

 Corless, R.M.; Gonnet, G.H.; Hare, D.E.G.; Jeffrey, D.J.; and Knuth, D.E. "On the Lambert W Function." Advances in Computational Mathematics, Vol. 5, (1996): 329-359.