Doubt on proof about integer basis of cubic field I'm reading the following proof from the book Problems in algebraic number theory by M. Ray Murty and Jody Esmonde

I understand everything except from what I've marked in yellow.
I know that $-3^3(ab)^2|d_K$ if $3|r$ and $-3(ab)^2|d_K$ otherwise but how can I prove the equality?
EDITED: I add some notation:

*

*$d_{K/\mathbb{Q}}(\alpha)$ is the discriminant of $\alpha$ that is
$$d_{K/\mathbb{Q}}(\alpha)=\operatorname{det}(\sigma_i(\alpha^j))^2$$
where $\sigma_i$ are the 3 homomorphisms from $K$ to $\mathbb{C}$ and $j$ goes from $0$ to $2$.

*d_K is the discriminant of $K$ that is the discriminant of any integer base where the discriminant of $\alpha_1, \alpha_2, \alpha_3$ elements of $K$ is
$$d_{K/\mathbb{Q}}(\alpha_1, \alpha_2, \alpha_3)=\operatorname{det}(\sigma_i(\alpha_j))^2$$

*An integer polynomial $f=a_n x^n + \cdots + a_1 x + a_0$ is called Eisenstenian with respect to a prime $p$ if $p \not| a_n$, $p|a_i$ for $i=0, \cdots, n-1$ and $p^2 \not | a_0$.

 A: I think I've solved it, and what I'm going to prove in the following is that
$$\begin{align}
 d_K&=-3(ab)^2 & \textrm{ if } \hspace{2mm} 3|m\\
d_K&=-3^3(ab)^2 & \textrm{ if } \hspace{2mm} 3 \not|m
\end{align}$$
To prove that $b^2|d_K$ what you do is to consider $\beta=\alpha^2/b$ and define
$$h=[\mathcal{O}_K:\mathbb{Z}+\mathbb{Z}\beta+\mathbb{Z}\beta^2]$$
Then, we can calculate that
$$d_{K/\mathbb{Q}}(\beta)=-3^3a^3r$$
and so
$$-3^3a^3r=h^2d_K$$
Then you see that for $g(x)=x^3-a^2b$ the minimal polynomial of $\beta$ we have that is Eisenstenian for every prime $p$ dividing $b$, so $p \not| h$ what implies that $b$ and $h$ are coprime and from last equation that $b^2|d_K$.
Now, we can say more because if $b \not = 1$ then for every prime $p$ dividing $b$ we have that $p$ does not divide $d_K/b^2$. In fact if this is not as
$$d_K/b^2 h^2=-3^3a^4$$
we have that $p|-3^3a^4$ but $a$ and $b$ are coprime (if not $ab$ cannot be squarefree), so $p|3$ and we have a contradiction because by hipotesis $3\not| b$.
Now, we know that in any situation $3a^2|d_K$ and $b^2|d_K$ and as $3a^2$ and $b^2$ are coprime, $3(ab)^2|d_K$.
Moreover as
$$m^2d_K=-3^3r^2=-3^3(ab)^2b^2$$
we have that $d_K<0$ and then there exists $c \in \mathbb{N}$ such that $d_K=-3(ab)^2c$ from what we get that
$$cm^2=3^2b^2$$
Now if $3|m$ then $m=3n$ for some natural number $n$, so
$$cn^2=b^2$$
and we get that $c|b^2$ so $c=1$ because if $c>1$ some of its prime factors divides $b$ and $d_K/b^2$ and we have prove that this is not possible. Because $c=1$ we have proven that $d_K=-3(ab)^2$.
If $3 \not | m$ then $3^2|c$ so $c=3^2n$ for some natural number $n$, so
$$nm^2=b^2$$
and as before we get that $n=1$, from what we get that $d_K=-3^3(ab)^2$.
