I'm reading a proof in my number theory textbook that all primes of the form $p = 4k+1$ are uniquely the sum of two squares. I'm stuck right at the beginning of the proof, where they say:
To establish the assertion, suppose that $$ p = a^2 + b^2 = c^2 + d^2 $$ where $a,b,c,d$ are all positive integers. Then $$ a^2 d^2 - b^2 c^2 = p(d^2 - b^2). $$
Perhaps I'm just missing something obvious, but I can't figure out how they managed to conclude that $a^2 d^2 - b^2 c^2 = p(d^2 - b^2).$ Please advise.