Hard water contains dissolved salts such as magnesium and calcium carbonates , bicarbonates or sulphates . It is difficult to produce lather from soap with hard water and an insoluble scum is formed . The metal ions Ca+2 and Mg+2 react with the stearate before any lather is produced . Hard water also produces scale in water pipes, boilers , and kettles
Temporary hardness 'is due to the presence of Mg(HCO3)2 and Ca(HCO3)2 . It is called temporary because it can be removed by boiling , which drives off CO2 and upsets the equilibrium
Permanent hardness is not removed by boiling and is due to MgSO4 or CaSO4 in solution . small quantities of pure water are prepared in the laboratory either by distilling the water or by passing it through an ion-exchange resin