# Sums of two Gaussian Integer squares

The well known Sum of Two Squares Theorem states that an integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no prime congruent to $$3\bmod4$$ raised to an odd power.

I wondered about extending this to Gaussian Integers: which Gaussian Integers are expressible as the sum of two squares of two other Gaussian Integers?

After exploration with Mathematica, a clear pattern seemed to emerge, using which I made the following conjecture:

Given $$z\in\mathbb{Z}[i]$$, there exists$${\space} z_1,z_2 \in\mathbb{Z}[i]$$ such that

$$z=z_1^2+z_2^2$$ $${}$$ iff $${}$$ $$\Im{(z)}\equiv{0\bmod4}$$ $${}$$ OR $${}$$ $$(\Im{(z)}\equiv{2\bmod4}\space\land\space\Re{(z)}\not\equiv2\bmod4)$$.

Has this conjecture been made/proven before? If so, how can one prove it?

The problem is solved in I. Niven, Integers of quadratic fields as sums of squares, Trans. Amer. Math. Soc. 48 (1940), no. 3, 405–417. See also Dasheng Wei, On the sum of two integral squares in quadratic fields $${\bf Q}(\sqrt{\pm p})$$.
Theorem 2 states, in part, A Gaussian integer of the form $$a+2bi$$ is expressible as a sum of two squares of Gaussian integers if and only if not both $$a/2$$ and $$b$$ are odd integers.