# How can we solve: $\sqrt{x} - \ln(x) -1 = 0$?

How could we solve $$\sqrt{x} - \ln(x) -1 = 0$$ without using Mathematica? Obviously a solution is $x = 1$, but what are the other exact solutions? This question is inspired by my first question How can we solve: $\sqrt{x} + \ln(x) -1 = 0$?. Here the situation is not clear. Any ideas?

-

The other real solution, according to Maple, is $4 \text{LambertW}(-1, -e^{-1/2}/2)^2$, which is approximately $12.34020237$. Note that if $f(x) = \sqrt{x} - \ln(x)$, $f'(x) = \dfrac{1}{2\sqrt{x}} - \dfrac{1}{x} = \dfrac{\sqrt{x}-2}{x}$, so $f(x)$ is decreasing on $(0,4]$ and increasing on $[4,\infty)$. Since $f(4) = 2 - 2 \ln(2) < 0$ while $f(x) \to +\infty$ as $x \to 0+$ and as $x \to +\infty$, there are two real solutions, one in $(0,4)$ and one in $(4,\infty)$.

To explain that LambertW solution: if $x = 4 t^2$ with $t > 0$, the equation says $$4 t^2 = x = e^{\sqrt{x}-1} = e^{2 t-1}$$ and thus $$-t e^{-t} = -e^{-1/2}/2$$ Now $\text{LambertW}(s)$ is defined to be a solution $w$ of $w e^w = s$. If $e^{-1} < s < 0$, as in this case $s = -e^{-1/2}/2$, there are two real solutions, the "principal branch" (which in this case gives $t=1/2$ and thus $x=1$), and the "$-1$ branch". There are infinitely many other branches, which are all complex.

-
thank you for the clear explanation! if I understand correctly - after researching the LambertW functions, we will resort to Newton's method to find an approximation to our second solution? – bigollo Jun 6 '12 at 10:44
Newton's method is one handy way of calculating LambertW, yes. It's not the only way. For example, you might use a Taylor series $${\it LambertW} \left( -1, \left( t-2 \right) {{\rm e}^{-2}} \right) = -2-t-{\frac {1}{6}}{t}^{3}+{\frac {1}{12}}{t}^{4}-{\frac {13}{120}}{t} ^{5}+{\frac {37}{360}}{t}^{6}-{\frac {593}{5040}}{t}^{7}+{\frac {883}{ 6720}}{t}^{8}-{\frac {55781}{362880}}{t}^{9}+{\frac {47123}{259200}}{t }^{10}-{\frac {1749037}{7983360}}{t}^{11}+\ldots$$ – Robert Israel Jun 6 '12 at 17:28

You could let $x=e^t$, and deal with the equation $f(t) = e^{\frac{t}{2}}-t-1 = 0$ instead. It is immediate that $f''(t)> 0$ (ie, strictly convex), $f(0) = 0$, $f'(0) <0$ and $\lim_{t\to\infty} f(t) = \infty$. Hence the equation has exactly two solutions.

Since $f(4)>0$ and $f$ is convex, using Newton's method (ie, $t_{new} = t-\frac{f(t)}{f'(t)}$) will produce a decreasing sequence that converges rapidly (quadratically) to the other solution. Starting from $4$, in 7 iterations the sequence hits the noise floor of my machine with $t \approx 2.51286241725234$. This corresponds to $x \approx 12.3402023625440$.

-