The Lambert function
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
lambertW(x
) lambertW(k
,x
)
For integer k, the values represent the solutions of the equation y e^{y} = x.
lambertW
is the inverse function of
.
In the complex plane, the equation y e^{y} = x has
a countably infinite number of solutions. They are represented by lambertW(k,
x)
with k
ranging over the integers.
For all real x ≥ 0,
the equation
has
exactly one real solution. It is represented by y=lambertW(x)
or,
equivalently, y=lambertW(0, x)
.
For all real x in
the range exp(1) < x <
0, there are exactly two real solutions. The
larger one is represented by y=lambertW(x)
, the
smaller one by y=lambertW(1, x)
.
Exactly one real solution lambertW(0, exp(1))= lambertW(1,
exp(1))= 1
exists for
.
For
, lambertW(k,
x)
takes no real value.
The values lambertW(1, 0)= infinity
and lambertW(0,
0)=0
are implemented. Further, the result y is
returned for some exact arguments of the form
.
For floatingpoint arguments a floatingpoint value is returned. For
all other arguments, unevaluated function calls are returned.
The float
attributes
are kernel functions, i.e., floatingpoint evaluation is fast.
When called with a floatingpoint argument, the function is
sensitive to the environment variable DIGITS
which determines
the numerical working precision.
We demonstrate some calls with exact and symbolic input data:
lambertW(3), lambertW(1, 5/2), lambertW(1/2), lambertW(5, I), lambertW(3, 1 + I), lambertW(1, x + 1)
Some exact values are found:
lambertW(1, exp(1)), lambertW(1, 2*exp(2)), lambertW(1, 3/2*exp(3/2)), lambertW(exp(1)), lambertW(2*exp(2)), lambertW(5/2*exp(5/2)), lambertW(1, (3+4*I)*exp(3+4*I))
Floating point values are computed for floatingpoint arguments:
lambertW(1, 0.3), lambertW(2000.0)
lambertW(3, 0.277), lambertW(1, 2345.6)
The functions diff
, float
, and series
handle expressions
involving the Lambert function:
diff(lambertW(k, x), x)
float(ln(3 + lambertW(sqrt(PI))))
series(lambertW(x), x = 0); series(lambertW(x), x = 1/exp(1), 3); series(lambertW(1, x), x = 1/exp(1), 3);

An arithmetical expression, the "argument" 

An arithmetical expression representing an integer, the "branch" 
Arithmetical expression.
R.M. Corless, D.J. Jeffrey and D.E. Knuth: "A sequence of Series for the Lambert W Function", in: Proceedings of ISSAC'97, Maui, Hawaii. W.W. Kuechlin (ed.). New York: ACM, pp. 197204, 1997.