“Illegal” computation for an ideal in $\mathbb{Z}[\sqrt d]$

I want to write out the ideal generated by $a+b\sqrt d$ (denoted by $I$) in $\mathbb{Z}[\sqrt d]=\{a+b\sqrt d:a,b\in\mathbb{Z}\},$ with $d$ square-free. \begin{align*} I&= (a+b\sqrt d)\mathbb{Z}[\sqrt d]= (a+b\sqrt d)(\mathbb{Z}+\sqrt d)\mathbb{Z}\\ &= (a+b\sqrt d)\mathbb{Z}+(a+b\sqrt d)\sqrt d\mathbb{Z}\\ &= a\mathbb{Z}+b\sqrt d\mathbb{Z}+a\sqrt d \mathbb{Z}+bd\mathbb{Z}\\ &= (a+bd)\mathbb{Z}+(a+b)\sqrt d\mathbb{Z}. \end{align*} But it seems that $a+b\sqrt d\notin (a+bd)\mathbb{Z}+(a+b)\sqrt d\mathbb{Z}.$ There should be something wrong in the computation above. Could you help me point it out?

-

2 Answers

The main mistake (which you made two or three times) is that while

$$(u + v) \mathbb{Z} \subseteq u \mathbb{Z} + v \mathbb{Z}$$

it is only an equality in special cases.

-

$(a+b\sqrt d)\mathbb Z + (a+b\sqrt d)\sqrt d\mathbb Z$ is the set of elements of the form $(a+b\sqrt d)n + (a+b\sqrt d)\sqrt dk=(a+b\sqrt d)n + (a\sqrt d+b d)k$ with $n,k\in\mathbb Z$. Those element cannot be rewritten in general to $(a+bd)n+(a+b)\sqrt d k$.

-