Soaps get precipitated in hard water, but not in soft water. Therefore, soaps can be used for checking the hardness of water. However, synthetic detergents do not get precipitated either cationic part of these detergents contains a long hydrocarbon chain and a positive charge on the N atom.
For example:
1. Anionic detergents: Anionic detergents are of two types
(a) Sodium alkyl sulphates: These detergents are sodium salts of long chain alcohols, they are prepared by first treating these alcohols with concentrated sulphuric acid and then with sodium hydroxide. Examples of these detergents include sodium lauryl sulphate (C11H23CH2OSO3 Na+) and sodium stearyl sulphate (C17H35CH2OSO3 Na+)
(b) Sodium alkyl benzene sulphonates: These detergents are sodium salts of long chain alkyl benzene sulphonic acids. They are prepared by Friedd-crafts alkylation of benzene with long chain alkyl halides or alkenes. The obtained product is first treated with concentrated sulphuric acid and then with in sodium hydroxide Sodium 4 - (1 –-dodecy) benzene sulphonate (SDS) is an example of anionic detergents.
2. Non-ionic detergents: Molecules of these detergents do not contain any ions. These detergents are esters of alcohols having high molecular mass. They are obtained by reacting polyethylene glycol and stearic acid.