Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
up vote 3 down vote accepted

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.

share|cite|improve this answer


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

and then,

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


share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.