Q:

If $d=\gcd(a+b,a^2+b^2)$, with $\gcd(a,b)=1$, then $d=1$ or $2$

Suppose $\gcd(a,b)=1$. Let  $d=\gcd(a+b,a^2+b^2)$.  I want to prove that $d$ equals $1$ or $2$.
I get that $d\mid2ab$ but I can't find a linear combination that will give me some help to use the fact that $\gcd(a,b)=1$.

A:

Well I found the solution. (Ohh and I was searching a solution without using prime numbers.)
Well $d\mid a^2+b^2-(a-b)(a+b)\;\Rightarrow\;d\mid 2b^2$. Same with $d\mid 2a^2$ so $d$ is a common divisor of $2b^2$ and $2a^2$ so it divides the $\gcd(2a^2,2b^2)=2\gcd(a^2,b^2)$. Since the $\gcd(a^2,b^2)=1$ because $\gcd(a,b)=1$ it follows that $d$ is a divisor of $2$, so it is $1$ or $2$.
I didnt find a way to continue with the $d\mid 2ab$....

A:

Suppose $p$ is a prime that divides $a+b$ and $a^2+b^2$, then $p$ also divides $2ab$ and therefore it divides $2$ or $a$ or $b$, but if $p$ divides $a$ and $a+b$...

A:

Hint $\,\ d=(a\!+\!b,a^2\!+b^2)\mid 2a^2,2ab,2b^2\Rightarrow\,d\mid(2a^2,2ab,2b^2)= 2(a,b)^2 = 2\ $ by $\ (a,b)=1$
Remark $\ $ More generally one easily proves $\ (a^2\!+b^2,a\!+\!b) = (2(a,b)^2,a\!+\!b)$

