<s>[INST] When does $\frac{a+b}{2}$ and $\sqrt{ab}$ have inversed tens digits and ones digits? Let $a$ and $b$ be natural numbers, and

$$A = \frac{a+b}{2}$$
$$B = \sqrt{ab}$$

It's given that $A$ and $B$ are two-digit numbers such that the tens digit of $A$ is the same as the ones digit of $B$, and the tens digit of $B$ is the same as the ones digit of $A$.

So $A = 10x + y\;\,$and$\;B = 10y + x$.

Also given is $A\ne B$.

What is $a$ and $b$?

My teacher gave us the answer without explaining it as: $a = 98$ and $b = 32$, which makes $A = 65$ and $B=56$.

My question is: How do you prove this? I know $98 = 2\cdot 7^2$ and $32 = 2^5$, but I don't understand how to find this specific answer.
 [/INST] Solve for $a$ in the second equation. Plug that into the first. Then solve for $b$. You get:
$b=A\pm \sqrt{A^2-B^2}$.
Plug in for $A=10x+y$ and $B=10y+x$ and expand. You get:
$b=10x+y\pm 3\sqrt{11(x^2-y^2)}$
The only multiples of 11 that are perfect squares are even powers of 11 times even powers of other primes. So, either $x^2=y^2$, which would give $A=B$, or $x^2-y^2=11$. Since $x,y \in \{1,2,3,4,5,6,7,8,9\}$, it is a simple matter of trial and error to find $6^2-5^2 = 36-25=11$.
Again with simple trial and error, you can verify that you cannot achieve $x^2-y^2$ to be 11 times some product of primes to even powers.
Edit: Check out this table of possible results:
http://www.wolframalpha.com/input/?i=Table%5BTable%5B(x,y,(x%5E2-y%5E2)%2F11),%7Bx,y%2B1,9%7D%5D,%7By,1,8%7D%5D
</s>