How do you solve $x^2 = \left(\frac 12\right)^x $?

Solution 1:

Hint: $$x^2=\left(\frac{1}{2}\right)^x\implies x=\sqrt{\left(\frac{1}{2}\right)^x}\implies x=\sqrt{\left(\frac{1}{2}\right)^\sqrt{\left(\frac{1}{2}\right)^\sqrt{\left(\frac{1}{2}\right)^\sqrt{\left(\frac{1}{2}\right)^{........}}}}}$$

Solution 2:

You can use Lambert $W$, the inverse to $x\mapsto xe^x$: $$\begin{align} x^2 &=\frac{1}{2^x}\\ x^22^x &=1\\ x^2e^{x\ln(2)} &=1\\ xe^{x\ln(2)/2} &=\pm1\\ x\ln(2)/2 e^{x\ln(2)/2} &=\pm\ln(2)/2\\ W\left( x\ln(2)/2 e^{x\ln(2)/2}\right) &=W\left(\pm\ln(2)/2\right)\\ x\ln(2)/2 &=W\left(\pm\ln(2)/2\right)\\ x &=\frac{2W\left(\pm\ln(2)/2\right)}{\ln(2)}\\ x &\approx0.766664\ldots,-2,\text{ or }{-4} \end{align}$$

In the last line there are three results, firstly owing to the $\pm$ in the input to $W$, and secondly owing to the second branch of $W$ which admits small negative inputs.