Let $K=\mathbb{Q}(\sqrt{-2})$. Show that $\mathcal{O}(K)$ is a principal ideal domain. Deduce that every prime $p\equiv 1, 3$ (mod 8) can be written as $p = x^2 + 2y^2$ with $x, y \in \mathbb{Z}$.
As $−2$ is squarefree $6\equiv 1$ (mod 4) we have $\mathcal{O}(K) = \mathbb{Z}[ \sqrt{2}$]. The discriminant is $\Delta$ = −8. The degree $n = 2$. The signature is $(0, 2)$. Thus the Minkowski bound is
$$ B_k = \frac{2!}{2^2}=\frac{4}{\pi}\times \sqrt{8} = \frac{4\sqrt{2}}{\pi}<2$$
Hence $Cl(K)$ is generated by the empty set of ideal classes and so $Cl(K) = \{1\}$. So this means $\mathcal{O}(K)$ is a principal ideal domain I believe...
Ok, now if we let $p \equiv 1$ or $3$ (mod 8). By quadratic reciprocity, $−2 ≡ \alpha^2$ (mod p) for some integer $\alpha$. Thus
$$X^2 + 2 ≡ (X + \alpha)(X − \alpha) \quad\text{(mod}~~ p).$$
Ok, now I am slightly stuck, can we apply some theorem here? Not sure if what above is correct to get to the desired result