TITLE: $x^y = y^x$ for integers $x$ and $y$
QUESTION [91 upvotes]: We know that $2^4 = 4^2$ and $(-2)^{-4} = (-4)^{-2}$. Is there another pair of integers $x, y$ ($x\neq y$) which satisfies the equality $x^y = y^x$?

REPLY [10 votes]: Well I finally found an answer relating to some number theory I suppose !
Assume that : $x={p_1}^{\alpha _ 1}.{p_2}^{\alpha _ 2}...{p_k}^{\alpha _ k}$ it is clear that number y prime factors are the same as number x but with different powers i.e: $y={p_1}^{\beta _ 1}.{p_2}^{\beta _ 2}...{p_k}^{\beta _ k}$ replacing the first equation we get:
${({p_1}^{\alpha _ 1}.{p_2}^{\alpha _ 2}...{p_k}^{\alpha _ k})}^y={({p_1}^{\beta _ 1}.{p_2}^{\beta _ 2}...{p_k}^{\beta _ k})}^x$ i.e: ${p_1}^{{\alpha _ 1}y}.{p_2}^{{\alpha _ 2}y}...{p_k}^{{\alpha _ k}y}={p_1}^{{\beta _ 1}x}.{p_2}^{{\beta _ 2}x}...{p_k}^{{\beta _ k}x}$
Since the the powers ought to be equal we know for each $1\le i \le k$ we have:${\alpha_i}y={\beta_i}x$ i.e: ${\alpha_i}/{\beta_i}=x/y$
Considering that the equation is symmetric we can assume that $x \le y$ but we have ${\alpha_i}/{\beta_i} = x/y \ge 1$ hence ${\alpha_i} \ge {\beta_i}$
Assume this obvious,easy-to-prove theorem:
Theorem #1
Consider $x,y \in \mathbb{N}$ such that $x={p_1}^{\alpha _ 1}.{p_2}^{\alpha _ 2}...{p_k}^{\alpha _ k}$  $y={p_1}^{\beta _ 1}.{p_2}^{\beta _ 2}...{p_k}^{\beta _ k}$ for each $1\le i \le k$ we have:
$y|x \to {\alpha_i}\ge{\beta_i}$ or vice versa

Using the Theorem #1 we can get that  $y|x$ i.e $x=yt$ replacing in the main equation we get:
$x^y=y^x \to ({yt})^y=y^{({yt})} \to yt=y^t$
Now we must find the answers to the equation $yt=y^t$ for $t=1$ it is obvious that for every  $y \in \mathbb{N}$ the equation is valid.so one answer is $x=y$
Yet again for $t=2$ we must have $2y=y^2$ i.e $y=2$ and we can conclude that $x=4$ (using the equation $x=yt$)so another answer is $x=4$ $\land$ y=2$ (or vice versa)
We show that for $t\ge3$ the equation is not valid anymore.
If $t\ge3$ then $y\gt2$ we prove that with these terms the inequality $y^t \gt yt$ stands.
$y^t={(y-1+1)}^t={(y-1)}^t+...+\binom{t}{2} {(y-1)}^2 + \binom{t}{1}(y-1) +1 \gt \binom{t}{2} {(y-1)}^2 + t(y-1) +1$
But we have $y-1\gt1$ so:
$y^t \gt \binom{t}{2} {(y-1)}^2 + t(y-1) +1= \frac {t(t-1)}{2} -t +1 +yt= \frac {(t-2)(t-1)}{2} + yt \gt yt$
So it is proved that for $t\ge3$ is not valid anymore.$\bullet$

P.S: The equation is solved for positive integers yet the solution for all the integers is quite the same!(took me an hour to write this all,hope you like my solution)