TITLE: Finding solution in naturals to $a^b=b^a$ with the help of $f(x)=\frac{\ln(x)}{x}$
QUESTION [7 upvotes]: As the title said, 
I'm trying to find solution in naturals numbers to $a^b=b^a$ with the help of the function 
$f(x)=\large\frac{\ln(x)}{x}$.
I've been reading some solutions of that problem posted in math forums, and still don't know how to deduce, the obvious solutions, $(2,4)$ and $(4,2).$
Thank you very much!

REPLY [4 votes]: Note that
$$
f'(x)=\frac{\mathrm{d}}{\mathrm{d}x}\frac{\log(x)}{x}=\frac{1-\log(x)}{x^2}\tag{1}
$$
Suppose that $a\lt b$ and $a^b=b^a$. Taking $\log$ and dividing by $ab$ yields
$$
\frac{\log(a)}{a}=\frac{\log(b)}{b}\tag{2}
$$
$(1)$, $(2)$, and Rolle's Theorem say that there must be an $x$ between $a$ and $b$ so that
$$
f'(x)=\frac{1-\log(x)}{x^2}=0\tag{3}
$$
$(3)$ is satisfied if and only if $x=e$. Therefore, if $a\lt b$, then
$$
a^b=b^a\Rightarrow a\lt e\lt b\tag{4}
$$
Thus, there are two options for $a\in\mathbb{Z}$, $1$ and $2$. Since $1^b=b^1\Rightarrow b=1$, the only solution with $a<b$ must have $a=2$. Since
$$
\frac{\log(2)}{2}=\frac{2\log(2)}{2\cdot2}=\frac{\log(4)}{4}\tag{5}
$$
we must have $b=4$. Any other solution, $x$, of $\frac{\log(2)}{2}=\frac{\log(4)}{4}=\frac{\log(x)}{x}$ must have $e$ between $2$ and $x$ and $e$ between $x$ and $4$. Both cannot be true simultaneously for any $x$.
The only solution is therefore
$$
2^4=4^2\tag{6}
$$