Proving primes that remain prime in ring of integers when d is congruent to 1 modulo 4 From Artin:

When $d$ is congruent $2$ or $3$ modulo $4$, an integer prime $p$ remains prime in the ring of integers of $\Bbb{Q}[$$\sqrt{d}]$ if the polynomial $x^2-d$ is irreducible modulo $p$.
a) Prove that this is also true when $d \equiv 1$ modulo $4$ and $p\neq 2$
b) What happens to $p=2$ when $d \equiv 1$ modulo $4$?

I have been stuck on this problem for a while, can any one give some tips to approach this question?
I was thinking maybe I can use the face that when $d \cong 1$ mod $4$ and $h = 1/4(1-d)$ a prime p generates a prime ideal $(p)$ of the ring of integers if and only if the polynomial $x^2-x+h$ is irreducible modulo $p$. But I really don't know how to apply this or if I even should. Any help is appreciated thanks.
 A: If $d \equiv 1$, then the ring of integers of $\mathbb{Q}(\sqrt{d})$ is $A = \mathbb{Z}[\frac{1+\sqrt{d}}{2}]$, and the minimal polynomial of $\beta =\frac{1+\sqrt{d}}{2}$ is $f(X) = X^2  - X -\frac{d-1}{4}$.  Note that $\frac{d-1}{4}$ is an integer.  As you mentioned, $p$ remains prime in $A$ if and only if $f$ is irreducible modulo $p$.  But by the quadratic formula, $f$ is irreducible if and only if $1 - 4(1)(-\frac{d-1}{4}) = d$ is not a square modulo $p$.  This is true if and only if $x^2 - d$ is irreducible modulo $p$.  I used the fact that quadratic polynomials are irreducible over a field $\iff$ they have no roots in that field twice.
When $p = 2$, you do the same thing: find out when $f$ has a root mod $2$.  If $\frac{d-1}{4}$ is odd, then $f(X) \equiv X^2 + X+1 \pmod{2}$.  If $\frac{d-1}{4}$ is even, then $f(X) \equiv X^2 + X$.  Are either of these polynomials irreducible?
To express your answer succintly, think about when $\frac{d-1}{4}$ even or odd.  (Hint: think modulo $8$)
