Proving $x=2,y=4$ is the only solution to $x^y=y^x$ Prove $x=2,y=4$ is the only solution to $x^y=y^x$ with the additional proviso that $x\ne y$ and $x,y$ are positive integers (if $(x,y)$ is a solution, so is $(-x,-y)$).
Ideally I am looking for a very simple proof - we can exhaust the possibilities below, and other possibilities look remote.
 A: Hint: Take $\log$ of both sides:
$$\frac{y}{x}=\frac{\log y}{\log x}.$$
Recall: $\frac{\log y}{\log x}=\log_xy$.
A: Take log on both sides and get
$$
\frac{\ln x}{x}=\frac{\ln y}{y}
$$
and note that the function $f(t)=\frac{\ln t}{t}$ is increasing for $t<e$ and decreasing for $t>e$. That means that if $x\neq y$, then one of them must be smaller than $e$. From there other integer solutions can be ruled out quickly.
A: Non-Calculus Solution:
Let us first look at solutions $(x,y)\in\mathbb{R}_{>0}\times \mathbb{R}_{>0}$ to $x^y=y^x$ such that $x > y$.  Let $r:=\frac{x}{y}$.  Then,
$$y^r=y^{x/y}=x=ry\,.$$
Thus, $y=r^{\frac{1}{r-1}}$, and $x=ry=r^{\frac{r}{r-1}}$.  Therefore, all solutions to $x^y=y^x$ with $x>y>0$ take the form $(x,y)=\left(r^{\frac{r}{r-1}},r^{\frac{1}{r-1}}\right)$, where $r>1$ is arbitrary.
Now, if we want rational solutions, then $r=\frac{p}{q}$ for some $p,q\in\mathbb{N}$ with $\gcd(p,q)=1$.  Hence, the solution $(x,y)$ associated to $r=\frac{p}{q}$ is $(x,y)=\left(r^{\frac{p}{p-q}},r^{\frac{q}{p-q}}\right)$.  As $\gcd(p,p-q)=1=\gcd(q,p-q)$, $r$ must be a $(p-q)$-th power.  That is, $p=u^{p-q}$ and $q=v^{p-q}$ for some $u,v\in\mathbb{N}$.  As $r>1$, we get $p>q$ and so $u >v$.  Thus, 
$$p-q=u^{p-q}-v^{p-q}=(u-v)\left(u^{p-q-1}+u^{p-q-2}v+\ldots+uv^{p-q-2}+v^{p-q-1}\right)\geq (p-q)(u-v)\,.$$
Hence, we must have $u-v=1$ and $p-q=1$.  Ergo, $r=1+\frac{1}{q}$, $x=\left(1+\frac{1}{q}\right)^{q+1}$, and $y=\left(1+\frac{1}{q}\right)^q$.  Thence, all rational solutions to $x^y=y^x$ with $x>y$ are of the form $$(x,y)=\left(\left(1+\frac{1}{q}\right)^{q+1},\left(1+\frac{1}{q}\right)^q\right)$$
where $q\in\mathbb{N}$.
Finally, to get integer solutions, we note that, for $q\in\mathbb{N}$, $1+\frac{1}{q}$ is an integer if and only if $q=1$.  Furthermore, any positive-integer power of a nonintegral rational number is nonintegral.  Therefore, only $q=1$ can make $(x,y)=\left(\left(1+\frac{1}{q}\right)^{q+1},\left(1+\frac{1}{q}\right)^q\right)$ have entries in $\mathbb{N}$.  Ergo, $(x,y)=(4,2)$ is the only positive-integer solution to $x^y=y^x$ with $x>y$.
A: Another way is to divide both sides by $x^x$, so $\displaystyle x^{y-x}=\left(\frac{y}{x}\right)^x$. Raising both sides to power of $\displaystyle \frac{1}{y-x}$ we get $\displaystyle x=\left(\frac{y}{x}\right)^{\large \frac{x}{y-x}}=\left(\frac{y}{x}\right)^{\Large \frac{1}{\frac{y}{x}-1}}$. Now, defining $y=tx$ we get $x=t^{\Large \frac{1}{t-1}} \Rightarrow y=t^{\Large \frac{t}{t-1}}$,
hence a solution is $\displaystyle (x,y)=\left(t^{\Large \frac{1}{t-1}},t^{\Large \frac{t}{t-1}}\right)$.
We want x to be an integer. if t-1 is bigger than 1 it can't be a factor of t, thus $\displaystyle \sqrt[t-1]{t}$ can't be an integer. It implies that $t-1=1$, thus $t=2$ and the only solution is $(2,4)$.
The equation is symmetric in terms of x and y, so the other possible solution is $(4,2)$.
A: Take logarithms. You want to analyze $f(t)=t^{-1}\log t$ and its repeated values. If you consider the derivative $f'(t)$ you should conclude that $f$ increases from $0$ to $t=e$ and then decreases to $0$ at $t=+\infty$. Try to play around with this a bit and see what it gives you. 
A: $f(t) = \dfrac{\ln t}{t}\to f'(t) = \dfrac{1-\ln t}{t^2}>0 \iff e > t > 0$. From this we see that if: $ t \geq 3 \Rightarrow f'(t) < 0 \Rightarrow f$ is strictly decreasing, and if $2 \geq t \geq 1 \Rightarrow f$ is strictly increasing. All of these mean that there is no more solutions with $x \neq y$ except $(x,y) = (2,4),(4,2)$ that has been found.
A: Let $f: \mathbb{R}^+ \to \mathbb{R}$, $f(x) = x^{1/x}$.
We are looking for positive $x, y$ where $f(x) = f(y)$.
Note that $f$ is differentiable, with
$$
f'(x) = x^{1/x} \frac{1 - \ln x}{x^2}.
$$
So, $f'(x) > 0$ for $x < e$, and $f(x) > 0$ for $x < e$.
It follows that if $f(x) = f(y)$, then either $x = y$, or one of $x, y < e$.
WLOG $x < e$.
Since $x$ is an integer, $x \in \{1, 2\}$.


*

*If $x = 1$, $1^y = y^1$, so $y = 1$, which contradicts $x \ne y$.

*If $x = 2$, $2^y = y^2$. $y = 4$ is a solution. Then, there is a unique $y$ on $[e, \infty)$ such that $f(x) = f(y)$, since $f$ is decreasing, which means $y = 4$ must be unique.


So the only solutions are $(2, 4)$ and $(4,2)$, which is what you listed.
A: The equation can be rewritten as an expression for $y$ as a function of $x$,
$$
y(x) = \frac{-x}{\log{x}} W\left(\frac{\log{x}}{-x}\right),
$$
where $W()$ is equal to Lambert W-function.
This function looks as follows:

which is linear ($y=x$) for $0<x<e$, after which it decays, with the limit,
$$
\lim_{x\to\infty} y(x) = 1.
$$
Thus the range of $y(x)$, for which $y\neq x$, is $1\leq y<e$. The only integers within this set are $1$ and $2$, but the corresponding $x$ value for $y=1$ is $\infty$, thus $(4,2)$ is the only integer solution for $x>0$.
