The Oxford Math Interview
Question 4
What is the largest number between \(e^\pi\) and \(\pi^e\)?

Start by assuming one is greater than the other and see if you can rearrange the inequality in a form that's easier to reason about:

$$ e^\pi \gt \pi^e \iff \log(e^\pi) \gt \log(\pi^e) $$ $$ \text{since } x \rightarrow \log(x) \text{ is strictly increasing} $$ $$ \iff \pi \log(e) \gt e \log(\pi) $$ $$ \iff \frac{\log(e)} {e} \gt \frac{\log(\pi)} {\pi} $$

Now define \(f(x) = \frac{\log(x)} {x} \) for \(x \gt 0 \). You can rewrite the above as: $$ e^\pi \gt \pi^e \iff f(e) \gt f(\pi) $$

So if you can show that \(f\) is strictly decreasing , at least in the interval \( (e, \pi) \), you are done! Well that's easy, just differentiate \(f\): $$ f^\prime(x) = \frac { \frac {1} {x} \times x - \log(x) \times 1 } { x^2 } $$ $$ = \frac {1 - \log(x)} {x^2} \lt 0$$ $$ \iff 1 - \log(x) \lt 0$$ $$ \iff 1 \lt \log(x)$$ $$ \iff e \lt x$$ So \(f\) is strictly decreasing in the interval \( (e, +\infty)\). Since \( e \lt \pi\), \( f(e) \gt f(\pi)\) and so \(e^\pi \gt \pi^e\).

Note that there is nothing special about \(e\) and \(\pi\) except that they are both \(\geq e\) (the inflexion point). The same solution works for the generic \(x^y\) and \(y^x\) problem provided \(x\) and \(y\) both fall in the interval \((0, e] \) or the interval \([e, +\infty)\).