TITLE: How do you solve $x^2 = \left(\frac 12\right)^x $?
QUESTION [12 upvotes]: I'm having trouble finding the steps to solve for $x$. The solutions to this equation are $x=-4$, $x=-2$, and $x=0.76666$ when solved graphically and through the solve function of a TI-nspire cx CAS.
I tried to isolate $x$ by using various log and power rules, but the result was still something I did not know how to solve.
$$x^2 =  \left(\frac 12\right)^x $$
$$\log x^2=\log\left(\frac12\right)^x$$
$$2\log x=x\log\left(\frac12\right)$$
$${\log x \over x}={\log \frac12 \over 2}$$
I also tried the following:
$$x^2 =  \left(\frac 12\right)^x $$
$$x^2 = {1^x \over 2^x} $$
$1^n=1$ for all real $n$
$$x^2={1 \over 2^x} $$
$$x=\sqrt {1 \over 2^x} ={1 \over \sqrt {2^x}}={1 \over [2^x]^{1/2}}= {1 \over 2^{x/2}}$$
How do you do this?

REPLY [3 votes]: You're forgetting that $x$ can also be less than $0$. Consider the function
$$
f(x)=\log(x^2)+x\log2=2\log|x|+x\log2
$$
(natural logarithm), defined for $x\ne0$.
We can easily compute the relevant limits:
$$
\lim_{x\to-\infty}f(x)=-\infty,
\quad
\lim_{x\to0^-}f(x)=-\infty,
\quad
\lim_{x\to0^+}f(x)=-\infty,
\quad
\lim_{x\to\infty}f(x)=\infty
$$
We also have
$$
f'(x)=\frac{2}{x}+\log2
$$
which is positive for $x>0$. The function has a local maximum at $-2/\log2$ and
$$
f(-2/\log2)=2\log\frac{2}{\log2}-\frac{1}{\log2}>0
$$
Thus the equation $f(x)=0$ has three solutions, two in the interval $(-\infty,0)$ (that are obviously $-4$ and $-2$) and one in the interval $(0,\infty)$.
Since $f(1)=\log2>0$ and $f(1/2)=-\frac{3}{2}\log2<0$,
we know that this solution is in $(1/2,1)$.
You can try an iteration, setting $x_0=1$ and $x_{n+1}=(1/2)^{x_n/2}$
\begin{align}
x_0&=1
\\
x_1&=0.70710678118654752441
\\
x_2&=0.78265402735568027271
\\
x_3&=0.76242798854892438203
\\
x_4&=0.76779124029202027521
\\
x_5&=0.76636542509760295727
\end{align}
and so on; this seems to converge quite fast.
There is no way to express the solution other than using the Lambert function trick, or other similar ones.