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

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? )

Solutions Collecting From Web of "How to solve this equation $x^{2}=2^{x}$?"

The equation can be written $x\log2=2\log|x|$. Let’s consider the function
defined for $x\ne0$.
We have easily
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
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.

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.