Numerical approximation to Lambert-like function

88 Views Asked by At

I have the following problem, where I'm trying to find the zero of the fuction $f(x)$:

$$f(x)=x\log(a+x)-c, \hspace{0.5cm} a,c,x>0, f(0) <0 \hspace{1cm}(1)$$

For which I'm trying to an approximation of the zero as I strongly suspect a closed-form solution isn't available.

It's been pointed out that the Lambert W function might be useful here (i.e. the inverse of $xe^x$); however this isn't not obvious to me. We could exponentiate our expression to get: $(a+x)^x-e^c=0$, which doesn't seem immediately amenable to solving using the Lambert W function.

With all of that said, what is a decent approximation to the zero of $f(x)$, as defined and parameterized in (1)?

1

There are 1 best solutions below

0
On BEST ANSWER

You look for the zero of function $$f(x)=x\log(a+x)-c$$ The solution is upper bounded by $$x_*=\frac{c}{W(c)}$$ which is the solution for $a=0$, $W(c)$ being Lambert function.

What you can show is that $f(x_*) \,f''(x_*)>0$; so, by Darboux theorem, using Newton method with $x_0=x_*$ there will never be an overshoot of the solution. So, use $$x_{n+1}=\frac{x_n^2+c x_n +a c}{(a+x_n) \log (a+x_n)+x_n}$$

Trying with $a=1234$ and $c=5678$, the iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & 842.83674 \\ 1 & 748.34976 \\ 2 & 747.91060 \\ 3 & 747.91059 \end{array} \right)$$ which is quite fast.

If you just want an approximation, limit the calculation to $x_1$.

Edit

Otherwise, as in my answer to your previous question, performing a series expansion around $x_*$ and a series reversion $$x \sim x_*+t-\frac{ (2 a+x_*)}{2 (a+x_*) ((a+x_*) \log (a+x_*)+x_*)}t^2+O\left(t^3\right)$$ where $$t=\frac{c-x_* \log (a+x_*)}{\frac{x_*}{a+x_*}+\log (a+x_*)}$$

Applied to the worked example, using the expansion to $O\left(t^2\right)$ gives $x=748.350$, while the expansion to $O\left(t^3\right)$ gives $x=747.924$.