Show that $p$ isn't a prime in $Q[\sqrt{-1}]$ I am working with Gaussian Integers. 
Part 1: Suppose $p$ is a rational prime congruent to $1$ mod $4$. How do I show that $p$ isn't a prime in $Q[\sqrt{-1}]$
Part 2: Using part 1 I need to show that if $p$ is a rational prime congruent to $1$ mod $4$ then there are rational integers $a$ and $b$ for which $p = a^2 + b^2$(an exact equality not congruence)
What I have done:
I don't know if this helps, but using the fact that $Q[\sqrt{-1}]$ is a UFD. Also in the book it says that "for every odd rational prime p, there is an $x$ that solves $x^2 ≡ −1$ mod $p$ for all rational primes $p$ that are congruent to $1$ mod $4$"
I wasn't able to do anything for part 2, because I am still having trouble with part 1. Can someone help me here?
 A: Let $p$ be a prime number. The ideal $(p)= p\Bbb Z[i]$ is prime (splits) in $\Bbb Z[i]$ if and only if the quotient ring
$$
A_p=\Bbb Z[i]/(p)
$$
is (is not) a field. But since $\Bbb Z[i]\simeq\Bbb Z[X]/(X^2+1)$ we easily have
$$
A_p\simeq\Bbb F_p[X]/{(X^2+1)}
$$
where $\Bbb F_p$ denotes the field with $p$ elements. Thus
$$
\text{$p$ factorizes in $\Bbb Z[i]$}
\Leftrightarrow
\text{$X^2+1$ factorizes in $\Bbb F_p[X]$}
\Leftrightarrow
\text{$-1$ is a square in $\Bbb F_p$}.
$$
When $p$ is odd the latter condition is itself equivalent to $\left(\frac{-1}p\right)=(-1)^{\frac{p-1}2}=1$ (Legendre symbol) and the latter holds if and only if $p\equiv1\bmod4$.
A: Suppose we already know that $-1$ is a quadratic residue of any (ordinary) prime $p$ congruent to $1$ modulo $4$. It follows that there exists an ordinary integer $a$ such that $a^2\equiv -1\pmod{p}$.
So $p$ divides $a^2+1$, that is, $p$ divides $(a+i)(a-i)$. Suppose that $p$ was a prime in the Gaussian integers. Then since the Gaussian integers are a UFD, we would have $p$ divides $a+i$ or $p$ divides $a-i$. But $p$ plainly divides neither. So $p$ cannot be prime in the Gaussian integers.
We now deal with Part 2,  using results/ideas that are likely already familiar. By Part 1, $p$ is not prime in the Gaussian integers. Thus $p$ is reducible. So there exist ordinary integers $a,b,c,d$ such that $(a+bi)(c+di)=p$ and neither $a+bi$ nor $c+di$ is a unit. 
Since $p$ has norm $p^2$, we must have that the norm of $a+bi$ and the norm of $c+di$ are each $p$. This says that $a^2+b^2=p$. 
