Detergents are ammonium or sulphonate salts of long chain carboxylic acids.
Detergents is effective in both hard and soft water.They have more cleansing action than soaps
Demerits of detergents are
1)they are non biodegradable.thus they cause pollution
2)Detergents in water bodies will produce algae and will reduce oxygen content in water
Calcium and magnesium ions are present in hard water
But unlike soaps detergents will not produce insoluble precipitates when in water.so they are effective than soaps