If $gcd(a,b)=d$ and $a^2+b^2=c^2$, show that $gcd(a,c)=gcd(b,c)=d$.
This is what I have so far. We know that $d|a$ and $d|b$ which implies that $d|c$, but that is not enough to show that $gcd(a,c)=gcd(b,c)=d$, only that they are at least $d$. Also $a^2=c^2-b^2$ and $b^2=c^2-a^2$. Any hints or solutions are greatly appreciated.
Hint:
You have found $d|c$ so $d|\gcd(a,c)$ and $\gcd(a,c) = kd$ for some positive integer $k$.
Then $k^2d^2 | a^2$ and $k^2d^2 | c^2$ so $k^2d^2 | (c^2-a^2)$.
This implies ... and ...