What causes the temporary and permanent hardness of water?
Temporary hardness of water is due to the presence of soluble salts of magnesium and calcium in the form of hydrogen carbonates (MHCO3,where M=Mg,Ca) in water.
Permanent hardness of water is because of the presence of soluble salts of calcium and magnesium in the form of chlorides, nitrates, and sulphates which will not be precipitated by boiling the water.