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
$$
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.

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.