Given that $x^y=y^x$, what could $x$ and $y$ be?

Here's a good way to look at this: $$ x^y = y^x \implies \\ y \ln x = x \ln y \implies\\ \frac{\ln x}x = \frac{\ln y}y $$ So one way of solving this is looking at the graph of $y = \frac{\ln x}{x}$ and seeing where it hits a particular value twice.

However, I'm going to go a step further. I will say that I want my solution $(x,y)$ of $x^y = y^x$ to be of the form $(x,ax)$ so that $y = ax$ for some value $a$. Furthermore, I'll assume that $x \neq y$ so that $a \neq 1$ (of course, $x = y$ is always a solution if $x^x$ is defined). With that, we have $$ \frac{\ln x}x = \frac{\ln (ax)}{ax} \implies (\text{assume } x\neq 0)\\ \ln x = \frac{\ln (ax)}{a} \implies\\ \ln x = \frac{\ln (a)}{a} + \frac{\ln x}{a} \implies\\ \frac{a-1}{a}\ln x = \frac {\ln(a)}{a} \implies (\text{we assumed }a \neq 1)\\ \ln x = \frac{\ln(a)}{a-1} \implies\\ x = a^{\frac{1}{a-1}} $$ So, for any value $a \neq 1$, the pair $x = a^{1/(a-1)},$ $y = a \cdot a^{1/(a-1)} = a^{a/(a-1)}$ will give you a solution to the original equation.

For example, plugging in $a = 2$ gives you $x=2$ and $y = 4$. Try some other values.


There is an explicit solution to this equation given by $$y = -\dfrac{x \operatorname{W}\left(-\dfrac{\log(x)}{x}\right)}{\log(x)}$$

where $\operatorname{W}(x)$ is the Lambert W-function.

Consider: $$x^y = y^x$$

Take the logarithm of both sides

$$y\log(x) = x\log(y)$$

$$\dfrac{y\log(x)}{x} = \log(y)$$

Multiply by $-1$ and exponentiate

$$\exp\left(-\dfrac{y\log(x)}{x}\right) = \dfrac{1}{y}$$

Multiply each side by $-\dfrac{y\log(x)}{x}.$

$$-\dfrac{y\log(x)}{x}\exp\left(-\dfrac{y\log(x)}{x}\right) = -\dfrac{\log(x)}{x}$$

Solve using the properties of the $\operatorname{W}$ function.

$$-xy\log(x) = \operatorname{W}\left(-\dfrac{\log(x)}{x}\right)$$

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


If we convert everything to polar form, we end up with

$$(r\cos\theta)^{r\sin\theta}=(r\sin\theta)^{r\cos\theta}$$

Take the $r$th root of both sides and you'll get

$$(r\cos\theta)^{\sin\theta}=(r\sin\theta)^{\cos\theta}$$

$$r^{\sin\theta}(\cos\theta)^{\sin\theta}=r^{\cos\theta}(\sin\theta)^{\cos\theta}$$

$$r^{\sin\theta-\cos\theta}=\frac{(\sin\theta)^{\cos\theta}}{(\cos\theta)^{\sin\theta}}$$

$$r=\left(\frac{(\sin\theta)^{\cos\theta}}{(\cos\theta)^{\sin\theta}}\right)^{1/(\sin\theta-\cos\theta)}$$

which is the curve you are interested in. A graph may be found here.

Plugging in $\theta=\arctan(0.5)$ will yield the rectangular coordinate $(4,2)$.