6

Find the integral solution of $$a^b - b^a = 3$$ I am a student of class 10 and got this question in a maths competetive exam.

I have tried converting into a log equation in one variable, or solve it by using parity but couldn't solve it.

Thanks in advance

Ali Caglayan
  • 5,726
geeky me
  • 373

3 Answers3

6

I suppose you are familiar with the inequality $\ln(1+x)\le x$. Now if $b>a$, then $$b^a=a^a\left(1+\frac{b-a} a\right)^a=a^a e^{a\ln(1+(b-a)/a)}\le a^a e^{b-a}.$$ When $a\ge 3$, we have
$$3=a^b-b^a\ge a^a(a^{b-a}-e^{b-a})\ge a^a(a-e)\ge27(3-e)>7$$ a contradiction. So $a\le2$ if $b>a$. But it can be checked that there is no solution for $a=1$ (obvious) and $a=2$ (since $2^b-b^2>3$ for $b\ge 5$). We conclude that there is no solution satisfying $b>a$. But $b\neq a$, so the only possibility is that $b<a$.

However, for $3\le b<a$, it's well-known that $a^b<b^a$. So it's only possible when $b\le 2$. For $b=1$ the solution is $(a,b)=(4,1)$. For $b=2$, due to the same reason above($a^2-2^a<-3$ for $a\ge 5$), there is no solution.

To conclude, the only solution is $(a,b)=(4,1)$.

kingW3
  • 13,496
Cave Johnson
  • 4,270
  • 1
    To be frank i am not familiar with it and had never thought in that way, but that was the reward i got with the question At the end of the day i got a new way of thinking. – geeky me Dec 20 '16 at 04:25
  • Apart from a small typo I corrected, this is the best answer on the page - not sure why it wasn't accepted. Either way, thanks for having put in the effort to write it all out – man_in_green_shirt Jan 23 '17 at 16:02
  • @man_in_green_shirt How would I accept an answer that I don't understand – geeky me Apr 27 '17 at 06:57
3

Consider the equation in modulo $3$, clearly we have $$ a^b\equiv b^a\pmod3 $$

Clearly $a=b=1$ is a solution of this equation. However this does not solve the original. We note that $4\equiv 1 \pmod 3\ $ and conclude that $a=4, b=1$. This a positive integer solution to your equation.

Ali Caglayan
  • 5,726
  • 2
    How did you get $a^b = b^a (mod 3). And how do we know that this is the only solution? – geeky me Dec 20 '16 at 03:14
  • @geekyme when you divide both sides of the equation by 3 there is no remainder on the right but the remainder on the left must be equivalent to $a^b-b^a$ which can be rearranged to give the solution. This does not assert that this is the only solution only shows your that there is one.

    It is the same as a parity argument that you said you tried. In a parity argument however you consider $(\mod 2)$. I chose $(\mod 3)$ as it gets rid of the $3$ and allows the equation to be written in a simpler form.

    – Ali Caglayan Dec 20 '16 at 03:18
  • So can't we find all solution or say (most probably) this will be the only solution. – geeky me Dec 20 '16 at 03:22
  • 1
    You can show that the only solutions of the modular equation are $a,b=1,\ a,b= 2$. For each of these cases you can show that there are one and none solutions of the original equation respectively. – Ali Caglayan Dec 20 '16 at 03:31
  • Thanks for that great answer. – geeky me Dec 20 '16 at 04:23
  • 1
    Beware that it does not make sense to solve $a^b\equiv b^a\pmod{3}$ where $a$ and $b$ are supposed to be taken mod $3$. For instance, $2^1\not\equiv 2^4\pmod{3}$ even though $1\equiv 4\pmod{3}$. To make sure that $a^b$ and $b^a$ are well-defined mod $3$, it turns out that you have to take $a$ and $b$ to be defined mod $6$ instead. – Eric Wofsey Dec 20 '16 at 04:39
  • 1
    @EricWofsey I am not solving the modulo 3 equation with the $4,1$ solution. I am solving the original. The modulo equation had solution $1$. $a$ and $b$ do not need to be taken mod 3 but you can show these are the only solutions. Later on you fiddle with the mod 3 for the original equation in order to find the correct solution. This is no means a rigorous proof but rather a here's how I would go round finding a solution. – Ali Caglayan Dec 20 '16 at 06:11
3

$a,b$ are of opposite parity,

If $b$ is odd, and $b>1$ we further have $b>a$. Then in the equation $a^b = b^a+3$ has LHS equal to $0$ modulo $8$, while RHS is $4$ modulo $8$.

If $a \ge 3$ is odd, then in the above equation, LHS and RHS will be $1, 3$ resp. modulo $8$.

The only remaining case is $b=1$, which gives $a=4$.

Hence the only solution is $(4,1)$.

Hari Shankar
  • 3,636
  • Why must you have $b>a$ if $b$ is odd and $b>1$? – man_in_green_shirt Jan 23 '17 at 15:46
  • 2
    @man_in_green_shirt We see that $(2,3)$ isnt a solution. So, $a \ge 4$ and $b \ge 3$ so that $a,b>e$. For $x >e, f(x) = x^{\frac{1}{x}}$ is a decreasing function. Now,$a^b = b^a+3 \implies a^b>b^a \implies f(a)>f(b) \implies a<b$ – Hari Shankar Jan 24 '17 at 03:40