## `lambertV, lambertW` -- lower and upper real branch of the Lambert function

#### Introduction

For real x, the values y=lambertV(x) and y=lambertW(x) represent the real solutions of the equation y*exp(y)=x.

#### Call(s)

`lambertV(x)`
`lambertW(x)`

#### Parameters

`x` | - | an arithmetical expression

#### Returns

an arithmetical expression.

#### Side Effects

When called with a floating point argument, the functions are sensitive to the environment variable `DIGITS` which determines the numerical working precision.

#### Details

- For all real x>=0, the equation y*exp(y)=x has exactly one real solution. It is represented by y=lambertW(x).

  For all real x in the range 0>x>-exp(-1), there are exactly two real solutions. The larger one is represented by y=lambertW(x), the smaller one by y=lambertV(x).

  Exactly one real solution lambertW(-exp(-1))=lambertV(-exp(-1))=-1 exists for x=-exp(-1).

- Thus, the upper branch `lambertW` is defined for real arguments from the interval [-exp(-1),infinity). It is monotonically increasing, attaining values in the interval [-1,infinity).

  The lower branch `lambertV` is defined for real arguments from the interval [-exp(-1),0). It is monotonically decreasing, attaining values in the interval [-1,-infinity).

- The values `lambertV`(0)=-`infinity` and `lambertW`(0)=0 are implemented. Further, the result y is returned for some exact arguments of the form x=y*exp(y). For real floating point arguments from the range of definition a floating point value is returned. For all other arguments, unevaluated function calls are returned.
- The `float` attributes are kernel functions, i.e., floating point evaluation is fast.

#### Example 1

We demonstrate some calls with exact and symbolic input data:

    >> lambertV(-4), lambertW(-3), lambertV(-5/2), lambertW(1/2),
       lambertV(I), lambertW(1 + I), lambertV(x + 1)

          lambertV(-4), lambertW(-3), lambertV(-5/2), lambertW(1/2),

             lambertV(I), lambertW(1 + I), lambertV(x + 1)

Some exact values are found:

    >> lambertV(-exp(-1)), lambertW(-2*exp(-2)),
       lambertV(-3/2*exp(-3/2)), lambertW(exp(1)),
       lambertW(2*exp(2)), lambertW(5/2*exp(5/2))

                              -1, -2, -3/2, 1, 2, 5/2

Floating point values are computed for floating point arguments:

    >> lambertV(-0.3), lambertW(2000.0)

                             -1.781337024, 5.836731495

The following arguments are not from the range of definition and lead to unevaluated calls:

    >> lambertV(-1.0), lambertW(-0.4), lambertV(0.1),
       lambertV(exp(1)), lambertV(5*exp(5))

          lambertV(-1.0), lambertW(-0.4), lambertV(0.1),

             lambertV(exp(1)), lambertV(5 exp(5))

#### Example 2

The functions `diff` and `float` handle expressions involving the Lambert function:

    >> diff(lambertV(x), x), diff(lambertW(x), x)

                         lambertV(x)          lambertW(x)
                     -------------------, -------------------
                     x (lambertV(x) + 1)  x (lambertW(x) + 1)

    >> float(ln(3 + lambertW(sqrt(PI))))

                                    1.334475971

#### Background

- Reference: 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. 197-204, 1997.

#### Changes

- new function
- [lambertV]
- new function
- [lambertW]

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000