7

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?

Daniel R
  • 3,199
user14554
  • 77
  • 6
  • 7
    Why should it reduce to that? $x=4$ and $y=2$ has $x \neq y$. – Randall Jan 14 '19 at 03:54
  • $4=2^2$? Why wouldn't it? It makes sense that if x and y are the same, they would satisfy this equation. If it doesn't though, then that's what I want to know. According to the algebraic properties of the productlog function, it should simplify in the way I presented, so if it doesn't actually work that way, it begs the question "why not?". – user14554 Jan 14 '19 at 03:55
  • 4
    No, $2^4=16=4^2$. – Randall Jan 14 '19 at 03:56
  • @Randall But then you still haven't explained why the algebra simplifies yet a counterexample remains. Why should it? Because that's what the algebra says it should do, according to the definition of the productlog which has the properties $W(ze^z)=z$. That property was the basis of deriving that solution in the first place. – user14554 Jan 14 '19 at 03:57
  • 8
    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 '19 at 03:58
  • Because the algebra shows that it should, as presented in the second-to-last line. – user14554 Jan 14 '19 at 03:59
  • 1
    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 '19 at 03:59
  • Okay, then show the complex algebra to correct it? Are you going to add or exponentiate by i? Also, you already provided a counterexample in positive numbers and still did not explain why the counterexample exists with the given algebraic properties of the productlog. The basis of that original solution is the property that $W(ze^z)=z$, why would that only algebraically simplify once but not twice? – user14554 Jan 14 '19 at 04:01
  • Again, a guess, but there's no reason a solution like this has to recover all solutions. Maybe you are right that this method recovers the trivial solutions $x=y$ but misses the others. – Randall Jan 14 '19 at 04:03
  • 1
    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 '19 at 04:07
  • 1
    As motivation, you might consider whether the relation $y = \arcsin(\sin(x))$ is "algebraically equivalent" to $y=x$. (What about when $y=0$ and $x=\pi$?) The same issue is at play here: $v = W(u)$ means that $u e^u = v$, but there is not always a unique $u$ with that property, and depending on which one you choose, your claim may or may not be valid. – Nate Eldredge Jan 14 '19 at 04:12
  • @NateEldredge If I am doing algebra, how do I "know" when that will be a problem? If you look at the question, they already used the productlog and regular log once, but they didn't have this failure of uniqueness dilemma despite both those functions having multiple branches. How come this uniqueness problem only arises when I make the final simplification to $y=x$? How else can I know that I've arrived at a form that captures all the solutions? – user14554 Jan 14 '19 at 04:15

2 Answers2

11

The Lambert $W$ function is not single-valued for negative arguments.

enter image description here

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.

Eric Towers
  • 67,037
  • 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 '19 at 04:18
  • +1 for the first parenthetical. – Randall Jan 14 '19 at 04: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 '19 at 04:19
  • Ok, one other problem then. Clearly $6^6 = 6^6$ and satisfies $x^y=y^x$ when $x=6, y=6$, right? Well, in your graph, the $x=y$ portion is only valid up to $x=e$, so where did the remaining $x=y$ solutions go? How do I get them back? – user14554 Jan 14 '19 at 04:20
  • 1
    @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 '19 at 04:27
  • Sure, how then do I know what I can fully simplify an expression in the form of $W(ue^{u})$ to $u$? – user14554 Jan 14 '19 at 04:34
  • @user14554 : Are you evaluating (applying $W$) or solving (applying $W^{-1}$)? If the former, your simplification is allowed ($\sqrt{9}$ is always $3$). If the latter, you get one or two solutions, one for each branch although the two can be equal. (You apply "inverse square" to $x^2 = 9$ to find $x = \pm 3$. Of course, $x^2 = 0$ gives the same value on each branch.) – Eric Towers Jan 14 '19 at 04:40
  • If I have an equation where I have applied $W(z)$ multiple times to simplify multiple ue^u expressions, do I then have 4 or 6 or 8 new branches I have to consider? Do I have to keep track of every single application of $W(ue^u)=u$ and write a separate domain for that? Like for instance, suppose I have $f(z)=(ze^z)e^{ze^z}$ To solve for $z$ I would have to use the productlog twice. – user14554 Jan 14 '19 at 04:44
  • @user14554 : Of course. How many solutions are there to $(x^2)^2 = 1$? Four. – Eric Towers Jan 14 '19 at 04:48
  • https://www.wolframalpha.com/input/?i=solve+productlog(productlog((ze%5Ez)e%5E(ze%5Ez))) shows only one branch cut. I suppose then as long as the solution is...real, I would still only worry about two solutions. When you say $x^4$, you really mean f(z=x+iy)=x^4 because otherwise you don't have a field to consider the 2 imaginary solutions. Over purely real numbers then, it seems there is some kind of shortcut. – user14554 Jan 14 '19 at 04:57
  • @user14554 : Try "-6 ProductLog[0,-Log[6]/6]/Log[6]" and "-6 ProductLog[-1,-Log[6]/6]/Log[6]". – Eric Towers Jan 14 '19 at 04:58
  • I am not so sure I would have 4 branches from 2 applications of the productlog. This is because if I make the distinction to say $W(x)=W_{0}(x)$, all instances of $W(x)$ now assume the principal branch, I don't have to worry about $2*2!$ combinations when I have taken one definition, I only have to consider when all instances are the $-1$ branch or when all instances are the $0$ branch. – user14554 Jan 14 '19 at 05:00
  • Ultimately, I think this could be resolved if there was a way to express multiple branches in terms of the original branch using an identity. For $ \arcsin$, it has multiple branches because $ \log(z)$ has multiple branches, but all of those branches can be rewritten as $log(x)+2 i \pi n$. If there was a similar formula for the productlog, this issue could be avoided. – user14554 Jan 14 '19 at 05:08
  • 1
    @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 '19 at 05:08
  • I'll save you the trouble because I know you're going to attempt to point out the function I presented has 4 complex branches to which I will reply Riemann surfaces can't be represented on the x-y Cartesian plane where the real-valued inverse lives, which is why Wolfram calculates only two real-valued inverse functions. So as I suspected, there is a shortcut for strictly real-numbers. – user14554 Jan 14 '19 at 05:36
  • I am making a protest comment because Eric's rude post has not been taken down and only mine, which criticized their condescension, was arbitrarily deleted without explanation. I will make as many emails, ip addresses and accounts as I need to protest this until that one comment is also erased or mine is restored, I am not letting this site get by with such poor integrity that defaces the rest of mathematicians. The public deserves to know there are members who do not have their arrogant attitude and do not seek to permeate the toxicity that has lead to the world-wide anti-science movement. – user14554 Jan 18 '19 at 21:06
2

The solution is:

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

which has the following form:

enter image description here

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 '19 at 04: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 '19 at 04:09
  • Right, why isn't it $y=x$ all the way. – user14554 Jan 14 '19 at 04:09
  • @user14554 I see your question now. – Randall Jan 14 '19 at 04:10
  • user14554 and Randall: There must be a branch cut in the Lambert W function. – David G. Stork Jan 14 '19 at 04:11
  • To clarify, I start with $x^{y(x)}=y(x)^{x}$. Suppose for functional analysis purposes I had an arrangement $f(x)^{y(x)}$ (where $y=y(x)$). If I substituted $y(x)$ for the productlog expression in your answer, would it have the property that it transforms any (real-valued) $f(x)^y$ into $y^{f(x)}$, or, is it only valid in the situation that $f(x)^{y(f(x))}=y(f(x))^{f(x)}$ implies $x^{y(x)}=y(x)^{x}$? – user14554 Jan 14 '19 at 05:30