# Is Mg(OH)2 more insoluble than MgCO3?

In removing temporary hardness by boiling, $\ce{Mg(HCO3)}$ is converted to $\ce{Mg(OH)2}$ but not $\ce{Mg(CO3)}$. The answer that I found in our coursebook was that it has a higher solubility product, but if its solubility product is higher, then it should be more soluble than $\ce{Mg(CO3)}$. Can you tell me the correct reason?

In temporary hardness, we have to remove $\ce{Mg^2+}$ ions by precipitating it. In $\ce{Mg(OH)2}$, $\ce{Mg^2+}$ ions in water are present in the concentration that is cube root of the solubility product, but in $\ce{Mg(CO3)}$ it is the square root of the solubility product. So, despite $\mathrm{K_{sp}}$ of $\ce{Mg(OH)2}$ being higher than $\ce{Mg(CO3)}$, $\ce{Mg^2+}$ ions in $\ce{Mg(OH)2}$ are comparatively less than $\ce{Mg^2+}$ ions in $\ce{Mg(CO3)}$.