# Confusion in proof that primes p=4k+1 are uniquely the sums of two squares.

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.

-

Write the two equations: $$p=a^2+b^2$$ $$p=c^2+d^2$$

Now, multiply the first by $d^2,$ the second by $b^2,$ and subtract the second from the first.

-

First,

$$p d^2 = d^2(a^2 + b^2),$$

and then,

$$p b^2 = b^2(c^2 + d^2).$$

Subtract.

-