I was trying to solve a problem from a regional contest where it was a mixture of bicarbonates of $\ce{Na}$ and $\ce{Mg}$ which was put at high temperature. What are the reactions of decomposition?
I've thought that the reactions are: $$\ce{2NaHCO3 -> Na2CO3 + H2O + CO2}$$ and $$\ce{Mg(HCO3)2 -> MgCO3 + H2O + CO2}$$
But, I found out that the second reaction is wrong. Actually, the reaction is
$$\ce{Mg(HCO3)2 -> MgO + H2O + 2CO2}$$
I searched on the web and I found the decomposition of other bicarbonates, like $\ce{Ca(HCO3)2}$ is similar to the first reaction. Is there any rule? When is carbonate and when is oxide? Or is $\ce{Mg}$ an exception?
Thanks!