# How to solve for third solution with Lambert W function.

The equation $$2^x = x^2$$ has 3 solutions $$2, 4$$ and $$-0.767$$. The lambert W function can be used to explicitly solve for 2 and 4 $$x\ln(2) = 2\ln (x)$$ $$\ln(\sqrt2)= \frac{1}{x}\ln (x)$$ $$\ln(\frac{1}{\sqrt2})= \frac{1}{x}\ln (\frac{1}{x})$$ $$\ln(\frac{1}{\sqrt2})= e^{ln (\frac{1}{x})}\ln (\frac{1}{x})$$ $$W(\ln(\frac{1}{\sqrt2}))= \ln(\frac{1}{x})$$ $$x = \frac{1}{e^{W(\ln(\frac{1}{\sqrt2}))}}$$ The solutions from the two real branches of the Lambert W function return 2 and 4 as the answers how can you algebraically arrive at the third?

There are 2 "choices" we need to keep in mind:

1. Which branch of $$W$$ we chose if $$z<0$$ (as you already indentified)
2. $$x^2 = f(x) \implies x = \pm\sqrt{f(x)}$$, we need to keep in mind both signs are possible.

So:

$$x^2 = 2^x \implies x = \pm e^{\frac{1}{2}x\log 2} \implies (-\tfrac{1}{2}x\log 2) e^{-\frac{1}{2}x\log 2} = \mp\tfrac{1}{2}\log 2$$

Thus, after applying lambert-W:

$$-\tfrac{1}{2}x\log 2 = W(\mp\frac{1}{2}\log 2) \implies x = \frac{W(\mp\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} = \begin{cases} \frac{W_0(-\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} &= 2\\ \frac{W_{-1}(-\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} &=4 \\ \frac{W_0(+\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} &= -0.766\ldots\\ \end{cases}$$

• Why $$\begin{cases} \frac{W_0(-\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} &= 2\\ \frac{W_{-1}(-\tfrac{1}{2}\log 2)}{-\tfrac{1}{2}\log 2} &=4 \\ \end{cases}$$ Jun 26, 2020 at 17:55
• @Mathsource I am not sure what you are asking. Since $-\tfrac{1}{2}\log 2 \in (-\tfrac{1}{e}, 0)$, we have to consider the values on both of the real values branches of the lambert W function. To find these values analytically one can use the properties of the lambert W function, in particular $W_{-1}(x\log x) = \log x$ for $x<\tfrac{1}{e}$ (take $x=-\tfrac{1}{2}$) and $W_{0}(-\log(x)/x) = -\log(x)$ for $x\in(0,e)$ (take $x=2$). en.wikipedia.org/wiki/Lambert_W_function Jun 27, 2020 at 22:43