## Every prime congruent to 1 mod 4 is a sum of squares

Prove that every prime integer $p$ congruent to 1 mod 4 is a sum of two squares. Show that every product of two such primes is also a sum of two squares.

Let $p$ be such a prime. We know that $p$ is not irreducible in $\mathbb{Z}[i]$; thus there exist nonunits $\alpha,\beta$ such that $p = \alpha\beta$. Note that neither of $\alpha$ and $\beta$ can have norm 1. Since $p^2 = N(p) = N(\alpha)N(\beta)$, letting $\alpha = a+bi$, we see that $a^2 + b^2 = p$ as desired.

Now suppose $p,q$ are integer primes congruent to 1 mod 4. As above, we have $p = \alpha_1\beta_1$ and $q = \alpha_2\beta_2$, where $\alpha_i$ and $\beta_i$ have norm $p$ and $q$ as needed. Now $N(\alpha_1\beta_2) = pq$. In particular, if $\alpha_1\beta_2 = a+bi$, then $a^2+b^2 = pq$.