Find $(a^2+b^2),$ where $(a+b)=\dfrac{a}{b}+\dfrac{b}{a}$ The question is the same .Find $a^2+b^2$. I think we have to find $a$ and $b$ firstly. Given that $a$ and $b$ are integers.

Lemma(1): Let $a$ & $b$ to be integers such that $ab \mid a^2+b^2$. 
If $\gcd(a,b)=1$, then prove that $a=\pm b$. 
Proof: We claim that $ab=\pm 1$.


*

*Proof of the claim: Suppose on contrary; that $1 < |ab|$. 
So there exist a prime number $p$, which divides $ab$; i.e. $p \mid ab$. 
Without loss of generality we can assume that $p \mid a$. 
So $p$ must divides $b^2=(a^2+b^2)-a^2$. 
[Because $p$ divides both of the $(a^2+b^2)$ & $a^2$.] 
So we can conclude that $p$ must divides $b$; 
which is an obvious contradiction with the assumption that $\gcd(a,b)=1$.


So we can conclude that $a=\pm 1$ & $b=\pm 1$; which implies that $a=\pm b$.


Lemma(2): Let $a$ & $b$ to be integers such that $ab \mid a^2+b^2$. 
Prove that $a=\pm b$. 
Proof: Let $d:=\gcd(a,b)$, 
so there exist integers $a^{\prime}$ & $b^{\prime}$ such that: 
$$ 
a=da^{\prime} \ , \ \ \ \ \ \ \ 
b=db^{\prime} \ , \ \ \ \ \ \ \ 
\gcd(a^{\prime},b^{\prime})=1 . $$
The relation $ab \mid a^2+b^2$, implies that there is an integer $k$, 
such that: 
$$
k(ab) = a^2+b^2  
\Longrightarrow 
k\big( (da^{\prime})(db^{\prime}) \big) = (da^{\prime})^2+(db^{\prime})^2 
\Longrightarrow 
k\big( a^{\prime}b^{\prime} \big) = (a^{\prime})^2+(b^{\prime})^2 , 
$$ 
so we obtain a pair $(a^{\prime},b^{\prime})$ such that: 
$$a^{\prime}b^{\prime} \mid (a^{\prime})^2+(b^{\prime})^2 \ , 
\ \ \ \ \ \ \ \ \ \ \ \ 
\gcd(a^{\prime},b^{\prime})=1 .$$
So by Lemma(1) we have: 
$$a=d(a^{\prime})=d(\pm b^{\prime})=\pm d(b^{\prime})=\pm b .$$


The relation 
$$a+b=\frac{a}{b} + \frac{b}{a} \ \ , \ \ \ \ \ \ \ (*)  $$ 
implies $ab(a+b)=a^2+b^2$, 
so we have: $ab \mid a^2+b^2$, 
so by the Lemma(2) we have one of the two folowing cases: 


*

*$a= + b$ , in this case both of the fractions 
on the Right-hand-side of the relation $(*)$, 
both are equal to $+1$, 
so the R-H-S is equal to $+ 2$. 
On the other hand in this case the Left-hand-side of the relation $(*)$ is equal to $2a$, so must have: $2a=+2$, which yields the solution $a=b=+1$. 

*$a= - b$ , in this case both of the fractions 
on the Right-hand-side of the relation $(*)$, 
both are equal to $-1$, 
so the R-H-S is equal to $- 2$. 
On the other hand in this case the Left-hand-side of the relation $(*)$ is equal to $0$, so must have: $0=-2$, which is impossible. 
So the quantity $a^2+b^2$ will be equal to $2$.
