<s>[INST] Prove that $5$ is irreducible in $\mathbb Z[\sqrt{2}]$ Consider the UFD $\mathbb Z[\sqrt{2}]$. Prime and irreducible elements there are the same. How do I show that $5$ is irreducible?
I tried to write $5=(a+b\sqrt 2)(c+d\sqrt 2)$ or $(2bd+ac-5)+(bc+ad)\sqrt 2=0$. We have $bc+ad=0$. If $c=0$, then either $d=0$ (in which case $5=0$) or $a=0$ (in which case $2bd=5$). Either case gives a contradiction. Suppose $c\ne 0$. Then $b=-(da)/c$. So $-2d^2a/c+ac-5=0$. But I don't see how to proceed. Maybe it's the wrong path?
 [/INST] Your equation
$$5=(a+b\sqrt 2)(c+d\sqrt 2) = (ac + 2bd) + (ad+bc)\sqrt2$$
gives the system
$$\begin{cases}
ac+2bd = 5\\
ad+bc = 0
\end{cases}$$
Multiplying the first equation by $d$, the second by $-c$ and adding them yields $$2bd^2 - bc^2 = 5d \implies b(2d^2-c^2) = 5d$$
Hence $5 \mid b$ or $5 \mid (2d^2 - c^2)$. However, the second possibility is impossible because $x^2 \equiv \pm 1 \pmod 5$.
Therefore $5 \mid b$.
Similarly, multiplying the first equation by $c$, the second by $-2d$ and adding them gives
$$ac^2-2ad^2 = 5c \implies a(c^2-2d^2) = 5c$$
As above we conclude $5 \mid a$.
Therefore $\exists \hat{a}, \hat{b} \in \mathbb{Z}$ such that $a = 5\hat{a}$ and $b = 5\hat{b}$.
We have
$$5 = (a+b\sqrt 2)(c+d\sqrt 2) = (5\hat{a}+5\hat{b}\sqrt 2)(c+d\sqrt 2) = 5(\hat{a}+\hat{b}\sqrt 2)(c+d\sqrt 2)$$
Dividing be $5$ gives
$$1 = (\hat{a}+\hat{b}\sqrt 2)(c+d\sqrt 2)$$
so $c + d\sqrt{2}$ is invertible in $\mathbb{Z}[\sqrt{2}]$ with $(c + d\sqrt{2})^{-1} = \hat{a}+\hat{b}\sqrt 2$.
</s>