Proof verification: find all positive integers $a$ and $b$ such that $a^b=b^a$. I need help with some details.
At first, we can consider $a\geqslant b$ WLOG.
Let $a^b=b^a.$ Notice that for $p$ prime we have  $p\mid a \implies p\mid b$ and $p\mid b \implies p\mid a$. Therefore, by unique factorization, $a$ and $b$ have the same prime factors.
Thus, we can write
$$a=p_1^{\alpha_1}\cdots p_n^{\alpha_n} \text{ and } b=p_1^{\beta_1}\cdots p_n^{\beta_n}$$
$$\implies
(p_1^{\alpha_1}\cdots p_n^{\alpha_n})^b=(p_1^{\beta_1}\cdots p_n^{\beta_n})^a$$ 
$$\implies
\alpha_1b=\beta_1a,\ \ldots\ ,\alpha_ib=\beta_ia $$
So for every $i$ we have $\alpha_i=\frac{m}n\beta_i\,(m,n)=1$

Now we want to show $n=1$.
$$\begin{aligned}a=b^{\frac{m}{n}}\\a^b=b^a\implies&{(b^\frac{m}n)}^b=b^{b^\frac{m}n}\\\implies&\frac{m}nb\ \ \ =b^\frac{m}n\\\implies &m^nb^n\ =n^nb^m\\\implies&{(\frac{m}n)}^n=b^{m-n}\end{aligned},$$
but right hand side is an integer so $n=1$ and $a=b^m$

$a^b=b^a \implies {(b^m)^b}=b^{(b^m)}\implies mb=b^m$
$$$$
if $m=b$ then $b^2=b^b\implies b=2,a=4$
$$$$
if $m<b$ then $m=b^{m-1}\Longrightarrow m=1, a=b$ 

But for $m>b$ I don't have any idea. Can you help me?
 A: Hopefully this is not against the spirit of the question, as I think you're on the right track and others in the comments are helpful. I just wanted to elaborate on my comment that there is another way using calculus instead of FTA.
Let $f:[1,\infty)\to\mathbb{R}$, $f(x) = x^{1/x}$. We seek distinct integers $a,b$ such that $f(a)=f(b)$. Observe:


*

*$f(x)$ has a local maximimum at $x=e$; logarithmic differentiation.

*In fact, $f'(x)<0$ for $x>e$ and $f'(x)>0$ for $1<x<e$

*$\lim_{x\to \infty}f(x)=1$; logarithms and LHR


Now $f(2)=f(4)$, and this is the only solution! Indeed, by the Intermediate Value Theorem for $n\geq 5$, $f(n)=f(\alpha)$, for some $\alpha\in (1,2)$. But there are no integers between $1$ and $2$.
A: If $m > b> 1$[1] then there are $q,r; 0\le r < b$ so that $m = qb + r$ and 
$mb = b^m$ means $qb^2 + rb = b^{qb}b^r$
$qb + r = b^{qb-1}b^r$.  if $r > 0$ then $b$ doesn't divide the left hand side but does the right so $r=0$ and
$qb = b^{qb-1}$
$q = b^{qb-2}$  which looks like infinite regress.
....
If $m > b$ then $m = \sum_{k=0}^w d_k b^k$ for some $w\ge 1$ and  $0\le d_k < b; d_w\ne 0$.
So $mb = \sum_{k=0}^w d_k b^{k+1}=\prod b^{d_kb^{k}}=b^m$
Inductively using the argument above we get that all $d_k = 0;k<w$ and that 
$mb = d_wb^{w+1} = b^{d_wb^{w}}$ and
$d_w = b^{d_wb^w - w-1}$.  As $1 \le d_w< b$ we must have $d_w = 1$ and $b^w = w+1$ which is clearly impossible for any $b>1$.

[1]  BTW, when you used $b^A = b^M \implies A = M$ you implicitely assumed $b\ne 1$.
But, of course, if $b=1$ then $a=1$ and we get our first trivial solution.
