# Why didn't they simplify $x^y=y^x$ to $x=y$?

Solving $$x^y = y^x$$ analytically in terms of the Lambert $$W$$ function

This "solution" for $$x^y=y^x$$ should simplify to $$y=x$$, but for some reason no pointed that out in the OP.

According to the stack exchange, the answer is $$y= \frac{-xW(-\frac{ln(x)}{x})}{ln(x)}$$. However, the term $$\frac{-ln(x)}{x}$$ itself can be rewritten as

$$\frac{-ln(x)}{x}=-ln(x)e^{-ln(x)}$$

Therefore, the productlog of that expression should simplify as follows,

$$y= \frac{-xW(-\frac{ln(x)}{x})}{ln(x)}, \ \ \ \ \$$ $$y= \frac{-xW(-ln(x)e^{-ln(x)})}{ln(x)}, \ \ \ \ \$$ $$y=\frac{-x(-ln(x))}{ln(x)}=x$$

Did this simplification just slip past everyone or is there something wrong about my algebra?

• Why should it reduce to that? $x=4$ and $y=2$ has $x \neq y$. – Randall Jan 14 at 3:54
• No, $2^4=16=4^2$. – Randall Jan 14 at 3:56
• I'm just confused why the solution "should" simplify to $x=y$ when there are solutions that do not satisfy $x = y$. – Randall Jan 14 at 3:58
• Anyway, to potentially answer your question, your algebra moves are invalid if $x$ is negative, and there are solutions with negative $x$. – Randall Jan 14 at 3:59
• But if the solution is algebraically equivalent to $y=x$, so why does the original representation contain any more solutions than $y=x$? There is definitely something more complicated being left out here. – user14554 Jan 14 at 4:07

## 2 Answers

The Lambert $$W$$ function is not single-valued for negative arguments. Using your "simplification" forces use of the lower branch, $$W \leq -1$$ when you assume $$W^{-1}(-\ln x)$$ only equals $$-\ln (x) \mathrm{e}^{- \ln x}$$. (The same thing happens when you assume the only square root of $$3^2$$ is $$3$$ or the only arcsine of $$1$$ is $$-3\pi/2$$.) You get two values from $$W^{-1}(-\ln x)$$ having the same algebraic form, but one has $$0 < x \leq \mathrm{e}$$ and one has $$x > \mathrm{e}$$. ("$$3^2$$" and "$$(-3)^2$$" have the same algebraic form, "$$x^2$$", but one has $$x>0$$ and one has $$x < 0$$.)

This is indicated explicitly in the identities at the Lambert $$W$$ function article on the English Wikipedia.

Edit: Got myself turned around with too many minus signs. I originally claimed the $$x=y$$ solutions were on $$W \geq -1$$, but this is backwards. It is corrected above.

• What is confusing is how $W(z)e^{W(z)}=z$ always simplifies no matter which branch you use, but $W(ze^{z})$ does not. – user14554 Jan 14 at 4:18
• +1 for the first parenthetical. – Randall Jan 14 at 4:19
• @user14554 : This is the usual problem with inverse functions. $\sqrt{9} = 3$, but "the things which square to $9$" is $\{-3,3\}$. This is always lurking around when you are solving equations. – Eric Towers Jan 14 at 4:19
• @user14554 : When $x = 6$, $W_{-1}$ gives $y = 6$ and $W_0$ gives $y = 1.624\dots$. You get them back the same way you do with any other function whose domain must be restricted to obtain the inverse function: you use a full set of inverses whose ranges cover the entire domain of the unrestricted function. – Eric Towers Jan 14 at 4:27
• @user14554 : I disagree. Every time you apply a $W^{-1}$, you get a contribution from $W_0$ and another from $W_{-1}$. You are, of course, free to incorrectly ignore solutions. I, on the other hand, will continue to find that $(x^2 - 3)^2-1=0$ has four real roots. – Eric Towers Jan 14 at 5:08

The solution is:

$$y = -\frac{x W\left(-\frac{\log (x)}{x}\right)}{\log (x)}$$

which has the following form: Clearly there are solutions other than $$x = y$$. Indeed, we see that for $$y=2$$ we can have $$x=2$$ or $$x=4$$ (intersection between blue and red dashed line).

• So it has something to do with the multiple branches of the log and productlog then. For $W_{0}(x)$ it simplifies, but when it changes to $W_{-1}(x)$ it doesn't. – user14554 Jan 14 at 4:09
• I think OP's question is why isn't the blue line simply $y=x$? It is tantalizing that it is $y=x$ for a while and then there's a sudden change. – Randall Jan 14 at 4:09
• Right, why isn't it $y=x$ all the way. – user14554 Jan 14 at 4:09
• @user14554 I see your question now. – Randall Jan 14 at 4:10
• user14554 and Randall: There must be a branch cut in the Lambert W function. – David G. Stork Jan 14 at 4:11