I need to solve the following equation for $x$
$(x^{2}+1)e^{-x}=u$
I tried Lambert's W function but couldn't find solution for $x$.
I need to solve the following equation for $x$
$(x^{2}+1)e^{-x}=u$
I tried Lambert's W function but couldn't find solution for $x$.
Copyright © 2021 JogjaFile Inc.
Just for your curiosity, there is a solution in terms of the generalized Lambert function writing $$e^{-x}=\frac u{(x+i)(x-i)}$$ (look at equation $(4)$ in the linked paper).
This being said, it is not very useful from a practical point of view and you will need some numerical method.
The case where $u$ is large is interesting to work. "Ignoring" the $1$, we have an approximate solution $$x_0=-2 W\left(\frac{\sqrt{u}}{2}\right)$$
Let us see how it works for $u=10^k$
$$\left( \begin{array}{ccc} k & x_0 & x \\ 1 & -1.49643 & -1.30664 \\ 2 & -2.65345 & -2.57381 \\ 3 & -4.09045 & -4.05078 \\ 4 & -5.72178 & -5.69932 \\ 5 & -7.48668 & -7.47267 \\ 6 & -9.34568 & -9.33629 \\ 7 & -11.2732 & -11.2666 \\ 8 & -13.2523 & -13.2474 \\ 9 & -15.2713 & -15.2675 \\ 10 & -17.3219 & -17.3189 \end{array} \right)$$
Looking at the iterations for $u=1234$ $$\left( \begin{array}{cc} n & x_n\\ 0 & -4.232452826 \\ 1 & -4.195927899 \\ 2 & -4.194973626 \\ 3 & -4.194972995 \end{array} \right)$$
Edit
The above approximation can be significantly improve writing $$x=-2 W\left(\frac{\sqrt{u}}{2}\big[1+\epsilon(u)\big] \right)$$ and using one iteration of Halley method starting with $\epsilon(u)=0$. This gives $$\epsilon(u)=-\frac{2 \left(t+1\right)^2 \left(2t+1\right)}{t^2\left(32 t^3+80t^2+70 t+23\right)} \qquad \text{where} \qquad t=W\left(\frac{\sqrt{u}}{2}\right)$$
Repeating the calculation for $u=1234$, this gives as initial estimate $-4.19498$.
Repeating the calculation with $u=10^k$ would lead to $$\left( \begin{array}{ccc} k & x_0 & x \\ 1 & -1.3084265 & -1.3066351 \\ 2 & -2.5738946 & -2.5738063 \\ 3 & -4.0507872 & -4.0507789 \\ 4 & -5.6993250 & -5.6993237 \\ 5 & -7.4726712 & -7.4726709 \\ 6 & -9.3362865 & -9.3362865 \\ 7 & -11.266569 & -11.266569 \\ 8 & -13.247397 & -13.247397 \\ 9 & -15.267528 & -15.267528 \\ 10 & -17.318923 & -17.318923 \end{array} \right)$$ which seems to be significantly better. We can still improve using for example one iteration of Householder method $$\epsilon(u)=-\frac{3 \left(t+1\right)^2 \left(64t^4+192 t^3+220 t^2+116t+23\right)} {1536t^8+7680 t^7+16320 t^6+19008t^5+12864 t^4+4800t^3+732 t^2-62t-23}$$ For $k=1$, this would give $-1.3068117$.
We could also do a Taylor expansion in terms of $\epsilon(u)$, then use series reversion and get $$\epsilon(u)=-\frac{\sum_{n=0}^{10} a_n t^n}{384 t (2 t+1)^{11}}$$ where tha $a_n$'s are $$\{1672,10847,55626,216212,616440,1275264,1888512,1950720,1333248,540672,98304\}$$ For $k=1$, this would give $-1.3067888$.