1 How to use LambertW to solve equation?

1.1 Example 1 \(ye^{y}=x\)
1.2 Example 2 \(y+e^{y}=x\)
1.3 Example 3 \(y+e^{y+c}=x\)
1.4 Example 4 \(e^{y}-ye^{y}=x\)
1.5 Example 5 \(x^{x}=5\)

LambertW, will be now called \(W\left ( z\right ) \), it also called the product log. The following three definitions will be used as is, in solving few problems

  1. \(W\left ( ze^{z}\right ) =z\)
  2. \(\ln \left ( W\left ( z\right ) \right ) =\ln \left ( z\right ) -W\left ( z\right ) \)
  3. if \(ye^{Ay}=z\) then \(y=\frac {W\left ( Az\right ) }{A}\)

Let see how to use the above to solve few equations.

1.1 Example 1 \(ye^{y}=x\)

Solve

\[ ye^{y}=x \]

For \(y\). Applying \(W\) function on both sides gives

\[ W\left ( ye^{y}\right ) =W\left ( x\right ) \]

But \(W\left ( ye^{y}\right ) =y\). Hence the above becomes

\[ y=W\left ( x\right ) \]

1.2 Example 2 \(y+e^{y}=x\)

Solve

\[ y+e^{y}=x \]

For \(y\). Taking the exponential of both sides gives

\begin{align*} e^{\left ( y+e^{y}\right ) } & =e^{x}\\ e^{y}e^{e^{y}} & =e^{x}\end{align*}

Let \(e^{y}=\alpha \) then the above becomes

\[ \alpha e^{\alpha }=e^{x}\]

Applying \(W\) on both sides gives

\[ W\left ( \alpha e^{\alpha }\right ) =W\left ( e^{x}\right ) \]

But \(W\left ( \alpha e^{\alpha }\right ) =\alpha \). Hence the above becomes

\[ \alpha =W\left ( e^{x}\right ) \]

but \(e^{y}=\alpha \), then

\[ e^{y}=W\left ( e^{x}\right ) \]

Taking log gives

\[ y=\ln \left ( W\left ( e^{x}\right ) \right ) \]

Using the relation \(\ln \left ( W\left ( z\right ) \right ) =\ln \left ( z\right ) -W\left ( z\right ) \) in the above gives

\begin{align*} y & =\ln \left ( e^{x}\right ) -W\left ( e^{x}\right ) \\ & =x-W\left ( e^{x}\right ) \end{align*}

Which is the solution to \(y+e^{y}=x\).

1.3 Example 3 \(y+e^{y+c}=x\)

Solve

\[ y+e^{y+c}=x \]

Taking the exponential of both sides gives

\begin{align*} e^{\left ( y+e^{y+c}\right ) } & =e^{x}\\ e^{y}e^{e^{y+c}} & =e^{x}\end{align*}

Let \(e^{y}=\alpha \) and \(e^{c}=\beta \) then the above becomes

\[ \alpha e^{\alpha \beta }=e^{x}\]

Using the third relation given above by applying \(W\) on both sides gives

\[ \alpha =\frac {W\left ( \beta e^{x}\right ) }{\beta }\]

But \(\alpha =e^{y}\), \(\beta =e^{c}\) then the above becomes

\begin{align*} e^{y} & =\frac {W\left ( e^{c}e^{x}\right ) }{e^{c}}\\ & =W\left ( e^{c}e^{x}\right ) e^{-c}\end{align*}

Taking log gives

\begin{align*} y & =\ln \left ( W\left ( e^{c}e^{x}\right ) e^{-c}\right ) \\ y & =\ln W\left ( e^{c}e^{x}\right ) +\ln e^{-c}\\ & =\ln \left ( W\left ( e^{x+c}\right ) \right ) -c \end{align*}

But \(\ln \left ( W\left ( z\right ) \right ) =\ln \left ( z\right ) -W\left ( z\right ) \). Hence the above becomes

\begin{align*} y & =\ln e^{c+x}-W\left ( e^{x+c}\right ) -c\\ & =\left ( c+x\right ) -W\left ( e^{x+c}\right ) -c\\ & =x-W\left ( e^{x+c}\right ) \end{align*}

1.4 Example 4 \(e^{y}-ye^{y}=x\)

Solve

\[ e^{y}-ye^{y}=x \]

For \(y\).

\[ e^{y}\left ( 1-y\right ) =x \]

Let \(1-y=u\) then \(y=1-u\) and the above becomes

\begin{align*} e^{1-u}\left ( u\right ) & =x\\ eue^{-u} & =x\\ ue^{-u} & =\frac {x}{e}\end{align*}

Let \(z=-u\)

\begin{align*} -ze^{z} & =\frac {x}{e}\\ ze^{z} & =-\frac {x}{e}\end{align*}

Applying \(W\) gives

\begin{align*} W\left ( ze^{z}\right ) & =W\left ( -\frac {x}{e}\right ) \\ z & =W\left ( -\frac {x}{e}\right ) \\ -u & =W\left ( -\frac {x}{e}\right ) \\ y-1 & =W\left ( -\frac {x}{e}\right ) \\ y & =W\left ( -\frac {x}{e}\right ) +1 \end{align*}

1.5 Example 5 \(x^{x}=5\)

Solve

\[ x^{x}=5 \]

Hence

\[ x\ln x=\ln 5 \]

But \(x=e^{\ln x}\). The above becomes

\[ \ln xe^{\ln x}=\ln 5 \]

Let \(\alpha =\ln x\)

\[ \alpha e^{\alpha }=\ln 5 \]

Applying \(W\) on both sides

\begin{align*} W\left ( \alpha e^{\alpha }\right ) & =W\left ( \ln 5\right ) \\ \alpha & =W\left ( \ln 5\right ) \\ \ln x & =W\left ( \ln 5\right ) \end{align*}

Taking exponentials gives the final answer

\[ x=e^{W\left ( \ln 5\right ) }\]