Approximation to the Lambert W function

Solution 1:

We can use a procedure known as "bootstrapping" to determine an approximation for the Lambert $W$ function. Let's go back to its definition.

For $x > 0$ the equation

$$ we^w = x $$

has exactly one positive solution $w = W(x)$ which increases with $x$. Note that $(w,x) = (1,e)$ is one such solution, so if $x > e$ then $w > 1$. By taking logarithms of both sides of the equation we get

$$ \log w + w = \log x $$

or

$$ w = \log x - \log w. \tag{1} $$

When $x > e$ we therefore have

$$ w = \log x - \log w < \log x. $$

In other words, our first approximation is that

$$ 1 < w < \log x \tag{2} $$

when $x > e$. We then have

$$ 0 < \log w < \log\log x, $$

and plugging this into $(1)$ yields

$$ \log x - \log \log x < w < \log x, \tag{3} $$

where the left side is positive for $x > 1$. Taking logarithms as before yields

$$ \log\log x + \log\left(1 - \frac{\log\log x}{\log x}\right) < \log w < \log\log x, $$

and upon substituting this back into $(1)$ we get

$$ \log x - \log\log x < w < \log x - \log\log x - \log\left(1 - \frac{\log\log x}{\log x}\right). $$

Since $w = W(x)$ we have shown that

$$ \log x - \log\log x < W(x) < \log x - \log\log x - \log\left(1 - \frac{\log\log x}{\log x}\right) \tag{4} $$ for $x > e$.

In your particular case we're interested in $W(e^{x+a})$, for which we have

$$ x+a - \log(x+a) < W(e^{x+a}) < x+a - \log(x+a) - \log\left(1 - \frac{\log(x+a)}{x+a}\right) $$

for $x+a > 1$. In this sense we have

$$ W(e^{x+a}) \approx x+a - \log(x+a) = x\left(1 - \frac{\log(x+a) - a}{x}\right) \tag{5} $$

when $x+a$ is large. Now by applying Taylor series a couple times we see that, for $x$ large and $a \ll x$,

$$ \begin{align} \frac{\log x - a}{x+1} &= \frac{\log x - a}{x} \cdot \frac{1}{1+\frac{1}{x}} \\ &\approx \frac{\log x - a}{x} \left(1-\frac{1}{x}\right) \\ &= \frac{\log x - a}{x} - \frac{\log x - a}{x^2} \\ &= \frac{\log(x+a-a) - a}{x} - \frac{\log x - a}{x^2} \\ &= \frac{\log(x+a) + \log\left(1-\frac{a}{x+a}\right) - a}{x} - \frac{\log x - a}{x^2} \\ &= \frac{\log(x+a) - a}{x} + \frac{\log\left(1-\frac{a}{x+a}\right)}{x} - \frac{\log x - a}{x^2} \\ &\approx \frac{\log(x+a) - a}{x} - \frac{a}{x(x+a)} - \frac{\log x - a}{x^2} \\ &\approx \frac{\log(x+a) - a}{x}. \end{align} $$

We may then conclude from $(5)$ that

$$ W(e^{x+a}) \approx x \left(1 - \frac{\log x - a}{x+1}\right) $$

for $x$ large and $a \ll x$.

Solution 2:

First, let's consider $x=y+\log(y)$.

Assuming that $y$ is big, we can assume that $\log(y)$ is smaller than $y$. Therefore, we take a first estimate of $y=x$ and apply Newton's method to $f(y)=y+\log(y)-x$ $$ \begin{align} y_{\text{next}} &=y-\frac{f(y)}{f'(y)}\\ &=x-\frac{x+\log(x)-x}{1+\frac1x}\\ &=x\left(1-\frac{\log(x)}{x+1}\right)\tag{1} \end{align} $$ For $x\ge1$, this is a decent approximation for $\mathrm{W}(e^x)$.

Now consider that $$ \frac{\mathrm{d}}{\mathrm{d}x}\mathrm{W}(e^x)=\frac{\mathrm{W}(e^x)}{\mathrm{W}(e^x)+1}\tag{2} $$ Thus, for small $a$, $$ \begin{align} \mathrm{W}(e^{x{+}a}) &\approx\mathrm{W}(e^x)+a\frac{\mathrm{W}(e^x)}{\mathrm{W}(e^x)+1}\\ &=\mathrm{W}(e^x)\left(1+\frac{a}{\mathrm{W}(e^x)+1}\right)\\ &\approx\mathrm{W}(e^x)\left(1+\frac{a}{x+1}\right)\tag{3} \end{align} $$ Combining the approximations in $(1)$ and $(3)$, we get $$ \mathrm{W}(e^{x{+}a})\approx x\left(1-\frac{\log(x)-a}{x+1}\right)\tag{4} $$