On p. 88 of Don Zagier's $\textit{Zetafunktionen und quadratische Körper}$, he defines the discriminant of an ideal $\mathfrak{a} \subset \mathcal{O}$ in the ring of integers of a quadratic number field, as $D(\mathfrak{a})=\textrm{det} \left(\begin{matrix}\alpha & \beta\\ \alpha' & \beta'\end{matrix} \right)^2$, where $\{\alpha, \beta \}$ is some $\mathbb{Z}$ basis for $\mathfrak{a}$.
He then makes the claim that
$$D(\mathfrak{a})=N(\mathfrak{a})^2 D$$
where $D$ denotes the discriminant of the quadratic field $\mathbb{Q}(\sqrt{d})$, so that we have either $D=4d$ or $D=d$ depending on the congruence relations of $d\ (\textrm{mod}\ 4)$, and $N(\mathfrak{a}):= [\mathcal{O} : \mathfrak{a}] = \lvert \mathcal{O}/\mathfrak{a} \rvert$ is the index of $\mathfrak{a}$ in $\mathcal{O}$.
He does not prove this but leaves it as an exercise.
The equality clearly holds for principal ideals, but I am stuck trying to prove it for non-principal ones.
Thank you for your attention.
$$O = \Bbb{Z}+\tau \Bbb{Z}, \qquad Disc(O) = \det(\pmatrix{1 & \tau\\ 1 & \tau'}^\top\pmatrix{1 & \tau\\ 1 & \tau'})= \det(\pmatrix{1 & \tau\\ 1 & \tau'})^2$$ it is an integer because the middle matrix has entries $Tr(b_ib_j)\in \Bbb{Z}$.
For a lattice $$L = (a+b \tau)\Bbb{Z}+(c+d\tau)\Bbb{Z}\subset O$$ $$Disc(L) = \det(\pmatrix{a+b\tau & c+d\tau\\ a+b\tau' & c+d\tau'})^2=\det(\pmatrix{1 & \tau\\ 1 & \tau'}\pmatrix{a & c\\ b & d})^2$$
$$O/L\cong \pmatrix{1 & \tau\\ 1 & \tau'}\Bbb{Z}^2/\pmatrix{a+b\tau & c+d\tau\\ a+b\tau' & c+d\tau'}\Bbb{Z}^2 \cong \Bbb{Z}^2/\pmatrix{a & c\\ b & d}\Bbb{Z}^2$$ $$|O/L| = |\Bbb{Z}^2/\pmatrix{a & c\\ b & d}\Bbb{Z}^2|=|\det(\pmatrix{a & c\\ b & d})|$$
Of course it works the same way in arbitrary number fields.