I'm familiar with a simple method of demonstrating that $e^\pi$ is greater:
$f(x) = \ln|x|/x$
$f'(x) = (1 - (\ln|x|))/(x^2)$ so f's max is at $(e, 1/e)$ so $1/e > \ln(\pi)/\pi$ and $e^{\pi} > \pi^e$
My question is simply, how does one come up with this "$\ln|x|/x$" function?
I've tried working backwards, but there doesn't seem any real clear way of coming up with this magic function that gives such an elegant solution to this problem.
Take logarithms.
$$e^\pi > \pi^e \Rightarrow \pi \log{e} > e\log{\pi} \Rightarrow \frac{\log e}{e} > \frac{\log \pi}{\pi }$$
This motivates us to consider the extrema of the function $f(x) = \frac{\log{x}}{x}$.