# Solve $2^x=x^2$

I've been asked to solve this and I've tried a few things but I have trouble eliminating $x$. I first tried taking the natural log: $$x\ln \left( 2\right) =2\ln \left( x\right)$$ $$\dfrac {\ln \left( 2\right) }{2}=\dfrac {\ln \left( x\right) }{x}$$ I don't know what to do from here so I decided to try another method: $$2^{x}=2^{\log _{2}\left( x^{2}\right) }$$ $$x=\log _{2}\left( x^{2}\right)$$ And then I get stuck here, I'm all out of ideas. My guess is I've overlooked something simple…

• Can you guess some solutions? You are not going to be able to "solve" the equation explicitly with precalculus tools. – Andrés E. Caicedo Dec 3 '13 at 16:07
• If you can graph $\ln(x)/x$, you will see that the equation has exactly two solutions. (Using calculus, this can be proved formally.) – Andrés E. Caicedo Dec 3 '13 at 16:08
• @Andres Caicedo the problem with $\ln(x)/x$ = $\ln(2)/2$ is that it doesn't accept negative $x$ as solutions, whereas there does exist a nontrivial negative solution to $2^x = x^2$, in addition to the (relatively) obvious positive integer roots. – Zubin Mukerjee Dec 3 '13 at 16:14
• en.wikipedia.org/wiki/Lambert_W_function – Alex Dec 3 '13 at 16:17
• @ZubinMukerjee Ah, yes, good point! Thanks. Besides $\ln(2)/2$, one may want to consider also $-\ln(2)/2$, because $\ln (x)/x =-\ln(2)/2$ is equivalent to $2^{-x}=(-x)^2$. – Andrés E. Caicedo Dec 3 '13 at 16:25

Your equation has two obvious solutions which are $x=2$ and $x=4$. The last solution is not rational ($x \approx -0.766665$) and cannot be obtained using simple functions. You cannot get the last root using logarithms.

• More precisely -0.76666469596212.. – Tomas Dec 3 '13 at 18:38
• The only function that gives it as an exact answer is a trancendental one, the lambert omega function, given in one of the answers below. – Alan Sep 22 '16 at 15:44

Consider the function$$f(x):=(\ln 2)x-2\ln x$$ then $f^\prime (x)=\ln 2-2/x$. Then it easily follows that $f^\prime (x)>0$ when $x>4$ and $f^\prime (x)< 0$ when $x<2$. That is $f$ is increasing when $x>4$ and it is decreasing when $x<2$. Also $4$ and $2$ are zeros of $f$. Hence it follows that these are the only zero for $x>0$.

For, $x<0$ put $x=-y$ and consider the function $$g(y)=-(\ln 2)y-2\ln y$$ Then $g^\prime (y)=-\ln 2-2/y<0$ for all $y>0$ i.e. the function is strictly decreasing and hence it has exactly one root for $x<0$.

• Going to logarithms, you miss one root. – Claude Leibovici Dec 3 '13 at 16:21
• @Claude Leibovici: Thanks for pointing that out, I have edited the answer. – pritam Dec 3 '13 at 16:32

There is a special function, $W_0(x)$ that is the inverse of $f(x)=xe^x$ when the latter is restricted to $x\in [-1,\infty)$. Using this, expressions of the form $Y=Xe^X$ can be solved as $X=W_0(Y)$. You want to find the solution(s) to the equation $2^x=x^2$. Rewrite $2^x$ as $e^{\ln(2)x}$ and raise each side to the power of $\frac{1}{2}$. We then arrive at $$x=e^{\frac{\ln(2)}{2}x}$$Multiple both sides by $\frac{-\ln(2)}{2}e^{\frac{-\ln(2)}{2}}x$ to arrive at $$\frac{-\ln(2)}{2} x e^{\frac{-\ln(2)}{2}x}=\frac{-\ln(2)}{2}$$Apply $W_0$ to both sides to get $$\frac{-\ln(2)}{2}x=W_0\left(\frac{-\ln(2)}{2}\right)$$ Multiply through to find $$x=\frac{-2}{\ln(2)} W_0\left(\frac{-\ln(2)}{2}\right)$$Which is equal to 2.

• As a side note, the name of this function (Family of functions) is the Lambert Omega function, if you want to search for it. This problem plagued me for almost 2 decades before I learned the solution :) – Alan Sep 22 '16 at 15:42

Resolution graphics:$$x^2=2^x<=>|x|=2^{\frac{x}{2}}$$

In the interval $(-\infty,0)$ the equation has a solution because the member function is strictly decreasing and the left from the right hand is strictly increasing. In the interval $(0, \infty)$, the equation has two solutions $2$ and $4$, the function of the left hand side is linear function and the function of the right hand is convex.

It is interesting to see that the two functions actually have three intersections. I would add that the non rational solution can be approximated by an iterative representation. Here I use $2^{-x} = x^2$, the solution to this equation is just negative of the solution to the original problem. The iteration would be: $$x_{n+1} = \frac{1}{2^{x_n/2}}$$ Start with $x_0 = 1$ and five iterations give you $0.766$.