# Lambert W function

Given the real or complex-valued function $$F(x) = xe^x$$, the Lambert W function $$W(y)$$ or product logarithm is the inverse of $$F(x)$$.

## Definition of Lambert W function

The Lambert W function can be defined as:

$\begin{array}{rrl} & F(x) &= xe^x\\ \Leftrightarrow & F^{-1}(F(x)) &= F^{-1}(xe^x)\\ \Leftrightarrow & W(F(x)) &= W(xe^x)\\ \Leftrightarrow & x &= W(xe^x) \end{array}$

or equivalently

$W(y)e^{W(y)} = y$

From the definion the following properties can be derived

$W(0) = 0$

$W(e) = 1$

$W'(0) = 0$

$a e^{-W(a)} = W(a)$

## Example $$x=W(1)=\Omega$$

Using Newton’s method, we are looking for the root of

$f(x) = xe^x - 1$

which stems from the definition with $$y=1$$:

$xe^x=1 \Leftrightarrow xe^x-1=0$

The root of $$f(x)$$ should be on $$(0, 1)$$, which we conclude by the Intermediate value theorem, since probing the function with the interval boundaries gives

$\begin{array}{l} f(0) = 0\cdot e^0 - 1 < 0\\ f(1) = 1\cdot e^1 - 1 > 1 \end{array}$

Therefore the desired $$\Omega$$ should be between 0 and 1. We now apply Newtons method using the derivative $$f'(x)= (x+1)e^x = xe^x+e^x$$:

$\begin{array}{rl} x_{n+1} &= x_n - \frac{f(x_n)}{f'(x_n)}\\ &= x_n - \frac{x_ne^{x_n}-1}{x_ne^{x_n}+e^{x_n}} \end{array}$

And get the following approximation:

$x_{1}=0.50000\dots\\x_{2}=0.57102\dots\\x_{3}=0.56716\dots\\x_{4}=0.56714\dots\\x_{5}=0.56714\dots\\$

Therefore $$\Omega \approx 0.567143$$, which is the omega constant that satisfies $$\Omega e^\Omega = 1$$

## Example $$x^x=2$$

$\begin{array}{rrl} &x^x &= 2\\ \Leftrightarrow&\ln(x^x) &= \ln(2)\\ \Leftrightarrow&x\ln(x) &= \ln(2)\\ \Leftrightarrow&\ln(x) e^{\ln(x)} &= \ln(2)\\ \Leftrightarrow&W(\ln(x) e^{\ln(x)}) &= W(\ln(2))\\ \Leftrightarrow&\ln(x) &= W(\ln(2))\\ \Leftrightarrow&x&= e^{W(\ln(2))} \end{array}$

## Example $$x = \ln(4x)$$

$\begin{array}{rrl} & x &= \ln(4x)\\ \Leftrightarrow& e^x &= 4x\\ \Leftrightarrow& \frac{1}{x}e^x &= 4\\ \Leftrightarrow& -xe^{-x} &= -\frac{1}{4}\\ \Leftrightarrow& W(-xe^{-x}) &= W(-\frac{1}{4})\\ \Leftrightarrow& -x &= W(-\frac{1}{4})\\ \Leftrightarrow& x &= -W(-\frac{1}{4})\\ \Leftrightarrow& x & \approx 0.357402956 \end{array}$

## Example $$x^2e^x = 2$$

$\begin{array}{rrl} & x^2e^x &= 2\\ \Leftrightarrow& \sqrt{x^2e^x} &= \sqrt{2}\\ \Leftrightarrow& xe^{\frac{x}{2}} &= \sqrt{2}\\ \Leftrightarrow& \frac{x}{2}e^{\frac{x}{2}} &= \frac{\sqrt{2}}{2} = \frac{1}{\sqrt{2}}\\ \Leftrightarrow& W\left(\frac{x}{2}e^{\frac{x}{2}}\right) &= W\left(\frac{1}{\sqrt{2}}\right)\\ \Leftrightarrow& \frac{x}{2} &= W\left(\frac{1}{\sqrt{2}}\right)\\ \Leftrightarrow& x &= 2W\left(\frac{1}{\sqrt{2}}\right)\\ \Leftrightarrow& x & \approx 0.901201032 \end{array}$

## Example $$x+e^x = 2$$

$\begin{array}{rrl} &x +e^x&= 2\\ \Leftrightarrow&e^x&= 2 -x \\ \Leftrightarrow&1 &= (2 -x)^{e^{-x}}\\ \Leftrightarrow&e^2 &= (2 -x)^{e^{2-x}}\\ \Leftrightarrow&W(e^2) &= W((2 -x)^{e^{2-x}})\\ \Leftrightarrow&W(e^2) &= 2 -x\\ \Leftrightarrow&x &= 2 - W(e^2)\\ \Leftrightarrow&x &\approx 0.442854401 \end{array}$

## Lambert W function Calculator

$$x\cdot e^x =$$ $$\Rightarrow x \approx$$ 0.5671432904097838

« Back to Book Overview