Temporary hardness is caused by the presence of dissolved calcium hydrogentrioxocarbonate(IV) and magnesium hydrogentrioxocarbonate(IV) which decomposes on heating to form calcium trioxocarbonate(IV) and magnesium trioxocarbonate(IV) respectively.