(i) Diazotization:
Aromatic primary amines reacts with nitrous acid in cold condition to give diazonium salts.
Ph−NH2+NaNO2+2HCl273−278K−−−−−−→PhN+2Cl−+NaCl+2H2O
Diazonium salts are stable for short time and decompose slowly even at low temperatures. They are used immediately after preparation. The diazonium group can be replaced by various nucleophiles such as halide anions, cyanide, thiols, water, and others.
(ii) Carbylamine reaction:
Aliphatic/aromatic primary amines are heated with chloroform/alcoholic KOH to form foul smelling alkyl isocyanides or carbylamines. This test is not given by secondary/tertiary amines.
R−NH2+CHCl3+3KOHΔ−→R−NC+3KCl+3H2O
For example, ethylamine gives ethyl isocyanide.
C2H5−NH2+CHCl3+3KOHΔ−→C2H5−NC+3KCl+3H2O