How to compare $a^b $and $ b^a $ ( for Eg. $ (\sqrt 2 )^{e} $ and $ e^{\sqrt2}$ ) such that $a \leq e \leq b$ and $a,b\geq 0 $ I have seen answer to similar question but it was about $ 3^{\pi}$ & $ { \pi }^3 $.
And they have done that through defining a function $f(x)=x^{\frac{1}{x}} $ also this function attains maximum at $'e'$ That can be shown easily .
My question is about How to compare two numbers $ a , b $ such that $a \leq e \leq b$ , what will we do there?
Any Help to overcome this problem is appreciable..!! 
 A: The function $x^{\frac{1}{x}}$ is decreasing for $x > e$. So if $ e<a<b $ then $a^{\frac{1}{a} } > b^{\frac{1}{b}}$ . In your case $ \color{red}{3^{\pi} > \pi^{3}}$.
EDIT:
In order to solve the problem when $a < e < b$ we need to invert the equation $ \frac{ln(b')}{b'}= \frac{ln(b)}{b}$ where $b'<e<b$. This can be done using the Lambert $W$ function. Given $b$, $b'$ can be calculated using 
\begin{eqnarray*}
b'= \exp( -W_0(-\frac{ln(b)}{b})).
\end{eqnarray*}
You can use Wolfie to do this calculation Eg $b=4$ https://www.wolframalpha.com/input/?i=e%5E(-productlog(-ln(b)%2Fb)),b%3D4
Then compare the returned value $b'$ with $a$. We are now in the increasing part of the function so if $a<b'$ then $a^{b'} < (b')^a$.
A: Say you want to determine if $a^b < b^a$.  Taking logarithms you see that this is true when
$$b \log a < a \log b$$
or, rearranging,
$$ {\log a \over a} < {\log b \over b}. $$
Letting $f(x) = (\log x)/x$, this is $f(a) < f(b)$.
Now, $f(x)$ is increasing on $x < e$ and decreasing on $x > e$.  So if $a < b < e$ or $e < b < a$ you have $a^b < b^a$.  For example you have $e < 3 < 4$ and so $4^3 < 3^4$ (which you could have found by directly computing $64 < 81$).
If you have $a < e < b$, on the other hand, this is harder and you need to compare $f(a)$ and $f(b)$ which may require actually computing them, depending on the particular values of $a$ and $b$ you care about.  For example you have $f(5) \approx 0.322$ and $f(2) \approx 0.347$, so $f(5) < f(2)$ and thus $5^2 < 2^5$.
Edit: as Donald Splutterwit has observed, $f(b) = f(b^\prime)$ where $b^\prime = \exp(-W(-\log(b)/b))$.   So in the case with $a < e < b$, we can solve the problem by comparing $a$ to $b^\prime$ computed in this way.  (This requires a means of computing the Lambert W function - the easiest way to do this will depend on your computation package of choice.)
A: For a comparison of $\,a\,$ and $\,b\,$ it's good to parametrize them: 
$\displaystyle a:=(1+\frac{1}{x})^x\leq e\enspace$ and $\enspace\displaystyle b:=(1+\frac{1}{x})^{x+1}\geq e\enspace$ , $\enspace x>0$ 
It follows $\,\displaystyle a^b=b^a\,$ .
Note: $\enspace\displaystyle\lim\limits_{x\to\infty}(1+\frac{1}{x})^x=e=\lim\limits_{x\to\infty}(1+\frac{1}{x})^{x+1}$
