TITLE: Quick proof to showing that $p\equiv 1\pmod{4}$ implies $p$ is reducible in $\mathbb{Z}[i]$?
QUESTION [6 upvotes]: I want to show that for $p$ a prime, if $p\equiv 1\pmod{4}$, then $p$ is not irreducible in $\mathbb{Z}[i]$. 
I know that $x^2\equiv -1\pmod{p}$ has a solution when $p\equiv 1\pmod{4}$, so $p\mid x^2+1$. I could then prove that $\mathbb{Z}[i]$ is a PID, so Euclid's lemma holds, and then see that $p\mid (x+i)$ or $p\mid (x-i)$, using the fact that $\mathbb{Z}[i]$ is a PID, so if $p$ is irreducible, then $p$ is prime. But then this gives a contradiction since $1/p$ is not an integer, so $(x\pm i)/p\notin\mathbb{Z}[i]$. 
I could do all this, but it seems like a lot of effort for the result. Is there a slicker, more elegant proof that $p\equiv 1\pmod{4}$ implies $p$ is not irreducible in the Gaussian integers?
By the way, I'm using this to finally conclude Fermat's theorem on the sum of two squares, so I don't want to refer to that in this.

REPLY [6 votes]: If you want to use the Gaussian integers then I don't think there's any way around the "long" chain of argument that involves showing it is a UFD. However, there are methods of proving Fermat's two-square theorem that make no mention of the Gaussian integers. (There had better be such a method since the Gaussian integers were introduced about 200 years after Fermat stated his two-square theorem and suggested it could be proved by descent. See Chapter 26 of Silverman's Friendly Introduction to Number Theory, 3rd ed., for a proof by descent.) 

David's answer mentions an approach using equivalence of binary quadratic forms. 
A second technique uses Minkowski's geometry of numbers (which is important in some basic theorems of algebraic number theory). You can read this in many textbooks on algebraic number theory, such as Section 7.2 of Stewart and Tall's "Algebraic Number Theory" (you don't need to know anything in the earlier part of the book). Or look at Section 5, Chapter 22 of Goldman's "The Queen of Mathematics: An Historically Motivated Guide to Number Theory".
Thue's lemma.  See pp. 264--265 of Burton's "Elementary Number Theory" (7th ed.).
The geometry of numbers and Thue's lemma are both closely related to the Pigeonhole principle.
Jacobi sums (Ireland & Rosen, p. 95). This requires knowing $({\mathbf Z}/p{\mathbf Z})^\times$ has an element of order 4 and leads to an explicit character sum which is a Gaussian integer of norm $p$. It doesn't require knowing the Gaussian integers have unique factorization. 
Continued fractions.  See C. D. Olds, "Continued Fractions", 132--133.

One advantage of the proof using unique factorization in the Gaussian integers is that it simultaneously gives you not just the existence of $a$ and $b$ such that $p = a^2 + b^2$ but also the uniqueness of $a$ and $b$ up to order and sign. Other techniques of proving the existence of $a$ and $b$ don't necessarily also explain why these integers are essentially unique (although the uniqueness aspect can be proved on its own too).