Finding integral basis of $K=\Bbb Q(\theta)$ Let $m$ be a cubefree integer. Set $m=hk^2$, where $h$ is square free, so that $k$ is square-free and $(h,k)=1$. Set $\theta=m^{1/3}$ and $K=\Bbb Q(\theta)$. Then an integral basis for $K$ is 
$$\{1,\theta,\theta^2/k\}; \text{if $m^2 \not \equiv1(\text{mod 9)}$}, $$
$$\{1,\theta,\frac{k^2\pm k^2\theta+\theta^2}{3k}\};  \text{if $m^2 \equiv 1(\text{mod 9)}$}.$$
Moreover, the discriminant $d(k)$ of $K$ is given by 
$$f(n) =
\begin{cases}
-27h^2k^2,  & \text{if $m^2 \not \equiv 1(\text{mod 9})$} \\
-3h^2k^2, & \text{if $m^2  \equiv 1(\text{mod 9})$}
\end{cases}$$
Can you help me with one problem so that I can do the rest by my own?
 A: There is a $p$-adic extensions way to investigate such problems.
Let $m\not \equiv 1\bmod 9$
$$K = \Bbb{Q}(m^{1/3}),\qquad R = \Bbb{Z}+m^{1/3} \Bbb{Z}+\frac{m^{2/3}}k \Bbb{Z}\subset O_K$$
Check it is a ring. 


*

*It contains $\Bbb{Z}[m^{1/3}]$ which is unramified at $p\nmid 3m$ thus each prime of $R$ above $p\nmid 3m$ is invertible.

*For $p| m, p\ne 3$ since $v_p(m^{1/3}) \in 1/3,2/3$ then $\Bbb{Q}_p(m^{1/3})/\Bbb{Q}_p$ is totally ramified, if $p | h$ then $v_p(m^{1/3}) = 1/3$, if $p| k$ then $v(m^{2/3}/k)=1/3$ thus one of $\pi = m^{1/3}$ or $\pi = m^{2/3}/k\in R$ is an uniformizer which means in $O_{\Bbb{Q}_p(m^{1/3})}$ : $(p,\pi^{1/3})^3 = (p)$, this stays true in $R$ so that the prime above $p$ is invertible.

*It remains to check $p=3$ : because $m \not \equiv 1 \bmod 9$ then $x^3-m$ is irreducible in $\Bbb{Z}_3[x]$ and since $x^3-m = (x-m)^3 \in \Bbb{F}_3[x]$ it means $\Bbb{Q}_3(m^{1/3})/\Bbb{Q}_3$ is totally ramified. Because $-1$ is a cube and one of $m,m^2/k$ is not divisible by $9$, and (from the binomial series for $(1+t)^{1/3}$) every element in $1+9 \Bbb{Z}_3$ is a cube, there is $a\in 2,3,4,5$ such that $\Bbb{Q}_3(m^{1/3})=\Bbb{Q}_3(a^{1/3})$. 
If $a = 3$ then $a^{1/3}$ is an uniformizer. Otherwise let $f(x)=  (x+a)^3-a$ then $v_3(f(0)) =v_3(a (a+1)(a-1))=1$ so $v_3(a^{1/3}-a)=1/3$ and $a^{1/3}-a$ is an uniformizer. Rephrasing it in term of $m^{1/3},m^{2/3}/k\in R$ we get that the prime of $R$ above $3$ is invertible.
Whence $R$ is a Dedekind domain so it must be $O_K$.
