# How would we solve $x^2 = 2^x$ mathematically rather than logically? [duplicate]

This question already has an answer here:

We have the equation in $x$: $$x^2 = 2^x$$

We know that, by logic, if we equate the bases and the powers separately, we get $x=2$ in both the cases and thus we conclude that $2$ is the root of the equation.

But what if we don't apply that logic. Is their a mathematical way we can get the same result? Using mathematical steps instead of intuition and logic?

## marked as duplicate by alex.jordan, J. M. is a poor mathematician, AD., Alex M., LucianJan 8 '17 at 12:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• We could consider this equation as a function. Find first derivate and analyse this function. – openspace Jan 8 '17 at 6:58
• What about $x=4$? – J. M. is a poor mathematician Jan 8 '17 at 7:02
• you could use the Lambert-W function – Dr. Sonnhard Graubner Jan 8 '17 at 7:03
• @J.M.isn'tamathematician yeah! Just realised that's also a solution. So, even if we know $x=4$, how can we show it? Thanks! – Mihir Chaturvedi Jan 8 '17 at 7:06
• @Dr.SonnhardGraubner could you explain the function? Thanks – Mihir Chaturvedi Jan 8 '17 at 7:08

## 3 Answers

Short answer: no, not probably in the way you'd like. This is a transcendental equation and in general these must be solved graphically if you can't find solutions by inspection as in this case. (Even in this case, you haven't found all of the solutions... there are complex solutions).

However, if you wish, this particular transcendental equation has solutions in terms of the lambert W function $w(z)$, which is defined by the equation $z = w(z) e^{w(z)}$ (which itself cannot be solved by doing algebra).

Your logic can only cover part of the solutions, but may not find out all of them.

If you are seeking real solutions only,

Take logarithm at both side

$$x^2=2^x$$ $$2\ln x=x\ln 2$$ $$\frac{\ln x}x=\frac{\ln2}2$$

Now consider the function $$f(x)=\frac{\ln x}x$$ $$f'(x)=\frac{1-\ln x}{x^2}$$

$f(x)$ is increasing in $(0,e)$ and decreasing in $(e,\infty)$.

Thus $f(x)=\frac{\ln2}2$ has exactly one solution at each of the region $(0,e)$ and $(e,\infty)$.

With observation we know the only positive real solutions are $x=2$ and $x=4$.

Edit:

As the comment and other answers suggested, there is also a negative solution given in terms of

the Lambert W function, which is defined as the inverse function of $f(z)=ze^z$.

We may use the identity

$$z=W(z)e^{W(z)}$$

Using this approach by @Aaron Maroja

$$x=-\frac2{\ln2}W(\frac{\ln2} 2)\approx-0.766$$

• ...and one can then use the Lambert function to display the other complex solutions. – J. M. is a poor mathematician Jan 8 '17 at 7:08
• no there is another solution – Dr. Sonnhard Graubner Jan 8 '17 at 7:08
• Here I assume the real solution only. I understand the concern though, but that already suggest OP's logic is incomplete. – Mythomorphic Jan 8 '17 at 7:09
• As someone above noted, there is also a negative real solution (as can be seen graphically). – spaceisdarkgreen Jan 8 '17 at 7:18
• For negative real $x$ that $\log$ is wrong.. and there you will miss a solution. – AD. Jan 8 '17 at 7:31

$x^y=y^x$ : $x=y$ => o.k. $\enspace$(trivial like $x=x$)

$x>y$ => relation by parametrisation $x=(1+\frac{1}{t})^{t+1}$ and $y=(1+\frac{1}{t})^t$ with $t>0$.

For $y=2$ in the first case we have $x=2$ and in the second case we get $x=4$ using $t=1$ .

If $x<0$ and $y=2$ you can change to $x^2=(\frac{1}{2})^x$ with $x>0$ but maybe that's not what you are talking about.