2

Please kindly support me to calculate a solution to this equation step by step :

$$\frac{x^2}a + ln(x) = b$$

x is the variable and a, b are constants. Unusually, I had to use WolframAlpha for the calculation. Not my style. The solution is

x=(sqrt(W((2*(exp^2b))/a)))*sqrt(a)/sqrt(2)

https://www.wolframalpha.com/input/?i2d=true&i=Divide%5BPower%5Bx%2C2%5D%2Ca%5D%2Bln%5C%2840%29x%5C%2841%29%3Db

where W is the Lambert W function. Now, as I am not quite confident with this function, is it possible to express the solution in this form (*)

$$x = k f(a)$$ where k is a constant and f(a) is a fucntion of the parameter a.

The reason of my request lies in the nature of my constant "a" which actually contains other parameters. For instance, in the previous solution, if "a" were not included in the Lambert W function, I would have x = k * sqrt(a). But it is not the case, W contains "a" and I don't know a to group the two "a" in the solution together.

Even an approximated solution of the original one in the form (*) would be really appreciated.

Thank you in advance! Mark

1 Answers1

1

$\require{begingroup} \begingroup$ $\def\e{\mathrm{e}}\def\W{\operatorname{W}}\def\Wp{\operatorname{W_0}}\def\Wm{\operatorname{W_{-1}}}$

\begin{align} \frac{x^2}a+\ln(x) &= b\tag{1}\label{1}\end{align}

The Lambert $\W$ function is indeed applicable in this case. To use it we need to transform \eqref{1} into an equivalent equation where the unknown $x$ is on the left side of the form $u(x)\exp(u(x))=v$. Then we can apply the Lambert $\W$ function to both sides of the equation $\W(u(x)\exp(u(x)))=\W(v)$ and get $u(x)=\W(v)$.

This is a step-by-step solution:

\begin{align} \frac{x^2}a+\ln(x) &= b \tag{2}\label{2} ,\\ \ln\left(x\exp\left(\frac{x^2}a\right)\right) &= b \tag{3}\label{3} ,\\ x\exp\left(\frac{x^2}a\right) &= \exp(b) \tag{4}\label{4} ,\\ x^2\exp\left(\frac{2x^2}a\right) &= \exp(2b) \tag{5}\label{5} ,\\ \frac{2x^2}a\exp\left(\frac{2x^2}a\right) &= \frac2a\exp(2b) \tag{6}\label{6} . \end{align}

At this point we can apply $W$ function:

\begin{align} \W\left(\frac{2x^2}a\exp\left(\frac{2x^2}a\right)\right) &= \W\left(\frac2a\exp(2b)\right) \tag{7}\label{7} ,\\ \frac{2x^2}a &= \W\left(\frac2a\exp(2b)\right) \tag{8}\label{8} ,\\ x^2 &= \frac a2\W\left(\frac2a\exp(2b)\right) \tag{9}\label{9} ,\\ x &= \pm\sqrt{\frac a2\W\left(\frac2a\exp(2b)\right)} \tag{10}\label{10} . \end{align}

Assuming that the real solution of \eqref{1} is expected, hence $x$ must be positive, we have to choose

\begin{align} x &= \sqrt{\frac a2\W\left(\frac2a\exp(2b)\right)} \tag{11}\label{11} . \end{align}

One more thing we need to keep in mind dealing with the real answers in terms of the Lambert $\W$ function: there are two so-called real branches (=two different real functions), one, $\Wp(z)$ called the principal branch, and the other one, called $\Wm(z)$. If the argument of $\W$ is not negative, that is, if $z>=0$, there is just one real solution, $\Wp(z)\ge0$. If $z<-\tfrac1\e$ then there are no real solutions, if $z\in(-\tfrac1\e,0)$ there are two real solutions, $\Wm(z)<-1<\Wp(z)<0$. Also, for $z=-\tfrac1\e$ we get $\Wm(z)=\Wp(z)=-1$.

$\endgroup$

g.kov
  • 13,581
  • Thank you so much for your astonishing answer. Really detailed and precise. Please allow me to ask you the remaining open question: is it possible to group together the parameter "a" contained in the sqrt and the other one contained in the the Lamber W function? In order to obtain x=k f(a) if i substitute b with a number. k is a constant. At the end, it is exactly my target.. – Mark Int Sep 02 '21 at 07:51
  • I have been trying to Taylor expand the W(x), following a previous answer in math.stackexchange, but w/o success as I obtain negative arguments in the sqrt.. – Mark Int Sep 02 '21 at 08:08
  • @ Mark Int: Are you expecting to set $b$ as some function of $a$ and get rid of $\operatorname{W}$? Is the range of $a$ known, in particular, is it supposed to be positive? – g.kov Sep 02 '21 at 08:54
  • 1
    @Mark Int: How did you get negative arguments in the $\sqrt$? If $a>0$ then $\operatorname{W}(2/a\exp(2b))>0$, if $a<0$ and $(2/a\exp(2b))\in[-1/e,0]$ then $\operatorname{W}(2/a\exp(2b))<0$, but again $a/2\operatorname{W}(2/a\exp(2b))>0$, so in both cases the argument of $\sqrt$ must be positive. Also, afaik, Taylor expansion is not known for the secondary real branch $\operatorname{W}_{-1}(z)$. – g.kov Sep 02 '21 at 10:08
  • yes exactly. Moreover, a>0. By using a Taylor expansion (only up to second order) of the Lamber W funtion that you previously obtained, I think that I obtained a reliable result with z=sqrt(k1-k2a) where k1 and k2 are constants (function of value 2 and parameter b>0) and a>0 of course is the mentioned parameter. Could you kindly confirm that it is correct? – Mark Int Sep 02 '21 at 10:10
  • 1
    @Mark Int: Why do you trying to avoid using $\operatorname{W}$? Is it software limitations? In fact it's very nice function, which even can be easily programmed with cubic convergence. – g.kov Sep 02 '21 at 10:19
  • because I need to group the parameters "a" together in the formula – Mark Int Sep 02 '21 at 11:37