<s>[INST] Find all solutions in positive integers to $a^b -b^a = 3$ 
Find all solutions in positive integers to $a^b -b^a = 3$

It appears that the only solution is $a=4, b=1$. 
Modular arithmetic is not of much help (apart from deriving that $a,b$ must have opposite parity). 
We know that $a^x$ dominates the polynomial $x^a$ but this does not seem to yield the result. 
Tried hard to estimate a bound for $a^b - b^a$ but with no success. 
Any help is appreciated. This is a problem from a regional mathematics Olympiad.
Added on 26 March, 2017:
I was trying to find a solution that involves no Calculus (or a minimum of Calculus) since this is a problem from a Junior Olympiad in which the students do not have a knowledge of Calculus. The following argument seems to work. Please point out flaws/mistakes, if any.
Lemma 1 For any $n \geq 4$, $$n^{n+1} - (n+1)^n > (n-1)^n - n^{n-1}$$
 Proof 
\begin{align*}
&\qquad n^{n+1} - (n+1)^n > (n-1)^n - n^{n-1} \\
&\Leftrightarrow n^{n+1} + n^{n-1} > (n-1)^n + (n+1)^n \\
&\Leftrightarrow n+\frac{1}{n} > \left(1-\frac{1}{n}\right)^n + \left(1+\frac{1}{n}\right)^n
\end{align*}
Since $\left(1+\frac{1}{n}\right)^n < 3$ and $\left(1-\frac{1}{n}\right)^n < 1$, we have 
$$\left(1+\frac{1}{n}\right)^n+\left(1-\frac{1}{n}\right)^n < 4 < n +\frac{1}{n}$$
 Lemma 2 For any $k$ and $n \geq 4$, 
$$n^{n+k} -(n+k)^n  > n^{n+1} - (n+1)^n$$
Proof 
\begin{align*}
&\qquad n^{n+k} -(n+k)^n  > n^{n+1} - (n+1)^n \\
&\Leftrightarrow n^{n+k} -n^{n+1} > (n+k)^n - (n+1)^n \\
&\Leftrightarrow n^k - n > \left(1+\frac{k}{n}\right)^n - \left(1+\frac{1}{n}\right)^n 
\end{align*}
Since $\left(1+\frac{k}{n}\right)^n < 3^k$ and $\left(1-\frac{1}{n}\right)^n < 1$, we have 
$$\left(1+\frac{k}{n}\right)^n+\left(1-\frac{1}{n}\right)^n < 3^k +1  < n^k - n $$
as $n > 4$.
Now suppose that $a^b - b^a = 3$.  Let $a \geq 4$. If $b = a+k > a$, then we have 
\begin{align*}
a^{a+k} - (a+k)^a &> a^{a+1} - (a+1)^a \\
&> (a-1)^a - a^{a-1} \\
&> \cdots \\
&> 3^4 - 4^3 = 17
\end{align*}
Thus there are no solutions with $b > a \geq 4$. 
If $a > b \geq 4$, then 
$$a^b - b^a = -(b^a - a^b) \leq -17 $$
from what we have seen above. Thus there are no solutions if $a > b \geq 4$. Thus all solutions can be only in the range $1 \leq a,b \leq 4$. Clearly, in this range only $a=4, b=1$ satisfies the given equation.
 [/INST] Consider $g(t) = a^t - t^a .$
Then $g'(t) = (\ln a) a^t - at^{a-1}$. 
Note that
$$ \left(\frac{t}{\ln (t)} \right )' = \frac{(-1 + \ln(t))}{\ln^2(t)}$$
and 
$$\left( \frac{t-1}{\ln(t)}\right)' = \frac{t(\ln (t) -1)+1}{t \ln^2(t)} $$
Thus both $t /\ln t$ and $(t-1)/\ln t$ are strictly increasing for $t > e$.
Therefore, for $a,t > e$ and $t >a$, $a^t > t^a$ and
$$ \frac{t-1}{\ln t} > \frac{a-1}{\ln a}$$
$$\Rightarrow a^{t-1} > t^{a-1} $$
$$\Rightarrow a^t > at^{a-1} $$
$$\Rightarrow (\ln a)a^t > at^{a-1}$$
That is, for $a,t > e$ and $t >a$, $g(t)$ is strictly increasing.
Thus for positive integers $ n, m \geq 3, n \neq m$, 
$|n^m-m^n| = n^m - m^n $ if $m >n$ and $m^n - n^m$ if $n > m$. Since g is increasing, we have $|n^m-m^n| \geq |n^{n+1}-(n+1)^n|$ or $|n^m-m^n| \geq |m^{m+1}-(m+1)^m|$.
Now, note that $h(x) = x^{x+1} - (x+1)^x$ is increasing for $x \geq 3$.
Thus $|n^m-m^n| > |3^4-4^3| = 17 > 3$. Thus no positive integer solutions exist for $n,m \geq 3$. The cases $n$ or $m \in \{1,2\}$ are easily verified, and the solution you found is the only one.
</s>