If a prime can be expressed as sum of two squares, then prove that the representation is unique.
My attempt:
If $a^2+b^2=p$, then it is obvious that $a,b$ of different parity.
Now, I assume the contraposition that the representation is not unique, $p=a^2+b^2=c^2+d^2$. Again, $c,d$ are of different parity.
Now, let $b,d$ be even and $a,c$ be odd.
So, $a^2+b^2=c^2+d^2 \implies a^2-c^2=d^2-b^2 \implies (a+c)(a-c)=(d-b)(d+b)$.
I cannot proceed any further. Please help.