Prove the set $\mathcal{O}_d := \left\{\frac{a + b\sqrt{d}}{2}:a,b \in \mathbb{Z}, a \equiv b \mod 2 \right\}$ is a ring. 
Prove that if $d$ is a non-square integer with $d \equiv 1 \mod 4$ then the set $$\mathcal{O}_d := \left\{\frac{a + b\sqrt{d}}{2}:a,b \in \mathbb{Z}, a \equiv b \mod 2 \right\}$$ is a ring, and in particular a integral domain.

Little bit stuck here. 
For $x,y \in \mathcal{O}_d,$ we define $+: \mathcal{O}_d \times \mathcal{O}_d \to \mathcal{O}_d$ by $(x + y) = \dfrac{a + b \sqrt{d}}{2} + \dfrac{a' + b'\sqrt{d}}{2} = \dfrac{(a+a') + (b+b')\sqrt{d}}{2} = \dfrac{a'+b'\sqrt{d}}{2} + \dfrac{a + b\sqrt{d}}{2} = (y + x) \in \mathcal{O}_d.$ 
We have that $0 = \dfrac{0 + 0\sqrt{d}}{2} \in \mathcal{O}_d$ and $\dfrac{a + b \sqrt{d}}{2} + \dfrac{-a + -b\sqrt{d}}{2} = \dfrac{(a-a) + (b-b)\sqrt{d}}{2} = 0 .$ Hence $-a \in \mathcal{O}_d.$ Also $$\begin{align} (x + y) + z &= \left(\dfrac{a + b\sqrt{d}}{2} + \dfrac{a' + b'\sqrt{d}}{2}\right) + \dfrac{a'' + b''\sqrt{d}}{2}  \\&= \dfrac{(a + a') + (b + b')\sqrt{d}}{2} + \dfrac{a'' + b''\sqrt{d}}{2} \\&= \dfrac{(a + a' + a'') + (b + b' + b'')\sqrt{d}}{2} \\&= \dfrac{a + b\sqrt{d}}{2} + \dfrac{(a'+a'')+(b+b'')\sqrt{d}}{2} \\&= \dfrac{a + b\sqrt{d}}{2} + \left(\dfrac{a'+b'\sqrt{d}}{2} + \dfrac{a''+b''\sqrt{d}}{2}\right) \\&= x + (y+z) \end{align}$$
for all $x,y,z \in \mathcal{O}_d.$
Hence $\mathcal{O}_d$ is a group under addition.
I've had difficulty showing the multiplicative operation $\circ: \mathcal{O}_d \times \mathcal{O}_d \to \mathcal{O}_d$ stays in the set. How do we define the operation so that $x \circ y \in \mathcal{O}_d?$ When I multiply two elements from $\mathcal{O}_d$ I get $x \circ y = \left(\dfrac{a + b \sqrt{d}}{2} \right)\left(\dfrac{a' + b' \sqrt{d}}{2} \right) = \dfrac{(a + b \sqrt{d})(a' + b'\sqrt{d})}{4} = \dfrac{aa' + ab'\sqrt{d} +ba'\sqrt{d} + bb'd}{4}= \dfrac{aa' + bb'd + (ab' +ba')\sqrt{d}}{4}$ which doesn't seem to be an element of $\mathcal{O}_d.$

Hint $\ $ Show that $\,{\cal O}_d = \Bbb Z\left[w\right],\ w = (1\!+\!\sqrt d)/2,\,$ using $\ w^2\! -w + n = 0,\,\ n =(1\!-\!d)/4$
