<s>[INST] Positive integers $a$ and $b$ are such that $a + b =\frac{ a}{b} +\frac{ b}{a}$. What is the value of $a^2 + b^2$? I tried to take $a = 1$ and $b = 2$ and arrive at the conclusion that $a^2 + b^2 = 2$ which indeed is the answer.
However, I wanted to prove this equation algebraically without using the replacement technique.
 [/INST] Either $a \ge b$ or $b \ge a$.  Without loss of generality (wolog) we might as well assume $b \ge a$, as were we to relabel variable $a$ with $b$ and $b$ with $a$ the expression would remain the same.  The proof will follow the same whichever $a$ or $b$ we assume to be the larger.  So let's assume $b \ge a$.
$a+b = \frac ab + \frac ba \le 1 + \frac ba \le 1 + b \le a + b $.
So $a+b = 1+b $ and $a = 1$.
So $1+ b = \frac 1b + b $ so $b = 1$.
So $a^2 +b^2 =2$.
</s>