Temporary hardness of water is caused due to the presence of bicarbonates of calcium and magnesium, i.e.,$Ca\left (HCO_3 \right )_2,Mg(HCO_3)_2$  while the permanent hardness of water is due to the presence of soluble chlorides and sulfates of calcium and magnesium, i.e.,$CaCl_2,MgCl_2$