How to solve this equation $$x^{2}=2^{x}$$

where $x \in \mathbb{R}$.

Por tentativa erro consegui descobri que $2$ é uma solução, mas não encontrei um método pra isso. Alguma sugestão?(*)

(Translation: By trying different values I've found that $2$ is a solution, but I couldn't find any method to this though. Any suggestions? )

  • 6
    $\begingroup$ $2,4$ are trivial, $-0.76666469596212309311\dots$ is obtained either by the Lambert W function or approximated by Newton method. $\endgroup$
    – UserX
    Oct 9, 2014 at 22:02
  • 1
    $\begingroup$ This problem plagued me for years, finding the third root. Only learned about the lambert omega function 2 years ago :) $\endgroup$
    – Alan
    Oct 9, 2014 at 22:05
  • 2
    $\begingroup$ يعني عادي الواحد يتكلم اي لغة هنا؟ $\endgroup$
    – seteropere
    Oct 9, 2014 at 23:24
  • $\begingroup$ The same question is treated here: math.stackexchange.com/questions/591124/solve-2x-x2 $\endgroup$ Mar 23, 2016 at 23:17

4 Answers 4


The equation can be written $x\log2=2\log|x|$. Let's consider the function $$ f(x)=x\log2-2\log|x| $$ defined for $x\ne0$. We have easily $$ \lim_{x\to-\infty}f(x)=-\infty, \qquad \lim_{x\to\infty}f(x)=\infty $$ and $$ \lim_{x\to0}f(x)=\infty. $$ Moreover $$ f'(x)=\log2-\frac{2}{x}=\frac{x\log2-2}{x} $$ Set $\alpha=2/\log2$; then $f'(x)$ is positive for $x<0$ and for $x>\alpha$, while it's negative for $0<x<\alpha$.

Thus the function is increasing in $(-\infty,0)$, which accounts for a solution in this interval. In the interval $(0,\infty)$ the function has a minimum at $\alpha$ and $$ f(\alpha)=\frac{2}{\log2}\log2-2\log\frac{2}{\log2} =2(1-\log2+\log\log2)\approx-0.85 $$ Since the minimum is negative, this accounts for two solutions in $(0,\infty)$, which clearly are $x=2$ and $x=4$.


Try this, first suppose $x > 0$, then you take $x<0$.

$$\begin{align}x^2 = 2^x &\Rightarrow (x^2)^{\frac{1}{2}} = (2^x)^\frac{1}{2} \Rightarrow x= 2^\frac{x}{2} \\ & \Rightarrow x \ e^{-x\frac{\ln\ 2}{2}} = 1 \Rightarrow -x \frac{\ln\ 2}{2}\ e^{-x\frac{\ln\ 2}{2}} = -\frac{\ln \ 2}{2} \\ &\Rightarrow -x \frac{\ln\ 2}{2} = W(-\frac{\ln\ 2}{2}) \Rightarrow x = -\frac{2\ W(-\frac{\ln \ 2}{2})}{\ln\ 2}\end{align}$$

Which gives us

$x = -\frac{2\ W(\frac{-\ln \ 2}{2})}{\ln\ 2} = 2$ , in case $x > 0$

Similarly we may find

$x = -\frac{2\ W(\frac{\ln \ 2}{2})}{\ln\ 2} \approx -0,76666$, in case $x < 0$

Where $W$ is the Lambert's funtion.

  • $\begingroup$ You might consider explaining how you obtained all three roots from this approach. It seems that one only obtains 1 root for $x<0$ and one other for $x>0$. Also, $-\frac{2W(-log(2)/2)}{\log(2)}=2$. You have a sign error and the incorrect root I believe. $\endgroup$
    – Mark Viola
    Jan 4, 2016 at 17:52
  • $\begingroup$ @Dr.MV I adressed to your observations. Thank you for pointing it out. $\endgroup$ Jan 4, 2016 at 18:46
  • $\begingroup$ @pitagoras When you posted this, did n't you get an indication of the same question in the past? $\endgroup$
    – Narasimham
    Jan 4, 2016 at 18:48
  • $\begingroup$ @Narasimham No, unfortunately. $\endgroup$ Jan 4, 2016 at 18:49
  • $\begingroup$ You're welcome. My pleasure. There is one more, of course, one more root, $x=4$. How do you account for it using this approach? $\endgroup$
    – Mark Viola
    Jan 5, 2016 at 3:02

I wrote about this in another post.

The other solution is 4.

For $x^a = a^x; a > 0$ in general... Well, notice the shapes of the graphs for $x \ge 0$ are such that they intersect twice if $a \ne e$ and intersect once if $a = 1$ (at $x = e$).

In my other post I went into great detail about taking the first and second derivatives to show both $a^x$ and $x^a$ are concave and that they can only have at most two intersections and as $a^0 = 1 > 0^a = 0$ there must have at least one. But I'll leave that as an excercise to the reader this time.

But obviously $x = a \implies a^a = a^a$ is a solution. The other ... hmm... I forget and I'm too lazy to figure it out a second time. But the solutions are "paired" (that is if $x = b$ solves $a^x = x^a$ then $x = a$ solves $b^x = x^b$) and one solution is less than e and the other is greater than e. I came up with a formula relating the solutions.

2 and 4 solves both $x^2 = 2^x$ and $x^4 = 4^x$ were the slickest solutions but every other positive value for $a$ and a $a$ and $a'$ solution.

If $a$ is even or an even rational then there is an $x = -1/a$ solution. But if a is odd then there is no negative solution as for $x < 0$ then $a^x > 0$ but $x^a < 0$. If a is irrational then $x^a$ is undefined for $x < 0$. These are the only solutions as $a^x$ is increasing but $x^a$ is decreasing when $x < 0$ and $a$ is even.

We see by observation that x = 2 and x = 4 are clearly solutions. 
We will prove by induction that 2^n > n^2 for all n >= 5. 
For the base case, n = 5 gives 32 > 25 which is true.
For the inductive case, we know that 2^n > n^2 and we want to show that 2^(n+1) > (n+1)^2. 
We will have that 2^(n+1) > 2*n^2 and because 2*n^2 = n^2 + n^2 > n^2 + 2*n + 1 when n >=5
(n^2 - 2*n - 1 = (n-1)^2 - 2 > 0 for n >= 5) we will also have that 2^(n+1) > (n+1)^2 as we wanted 
to show. By induction 2^n > n^2  for n >= 5 and the only solutions are x=2 and x = 4.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.