I have the following question:
If $a$ and $b$ are positive integers such that $b > a$, when will $a^b = b^a$?
I could not solve it, so I looked at the answer:
If $a$ and $b$ are positive integers such that $b > a$, $a^b = b^a$ when $a = 2$ and $b = 4$.
It is not easy to prove that this is the only solution; students should use guess and check to find a solution.
The answer provides no proof or insight into the method for finding the solution, apart from a vague mention of "guess and check".
I wish to find the (algebraic, if possible) proof for the question. To sum up:
Given that $a > 0$, $b > 0$ and $b > a$, prove that the only solution of $a^b = b^a$ is that $a = 2$ and $b = 4$.
Suppose $a>b$. Since $a^b=b^a$, any prime that divides $a$ must divide the right-hand side, so it divides $b$. Similarly, any prime dividing $b$ divides $a$, so $a$ and $b$ have the same prime factors. Say $$ \begin{align}a&=p_1^{a_1}p_2^{a_2}\cdots p_k^{a_k}\\ b&=p_1^{b_1}p_2^{b_2}\cdots p_k^{b_k}\end{align}$$ for primes $P_i$ and positive integers $a_i,b_i$.
We have $$ p_1^{ba_1}\cdots p_k^{ba_k}=a^b=b^a=p_1^{ab_1}\cdots p_k^{ab_k}$$ By the fundamental theorem of arithmetic, $$ba_i=ab_i,\ i=1,\dots,k$$
Since $\frac{a}b>1$, we have $a_1>b_i$ for $i=1,\dots,k$ and so $\frac ab=p_1^{a_1-b_1}\cdots p_1^{a_k-b_k}$ is an integer, say $a=nb$.
Now we have $(nb)^b= b^{nb}\implies \sqrt[n-1]{n}=b$. Since $b$ is an integer, we must have $n=1$ and then $b=2, a=4$.