Solution to equation (x^2)/a + ln(x) = b

118 Views Asked by At

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

There are 1 best solutions below

7
On BEST ANSWER

$\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$