The general formula of a carboxylic acid is RCOOH. Here, an acyl group is attached to a hydroxyl group by a single bond. Carboxylic acid derivatives are compounds where the hydroxyl group is replaced by other functional groups. For example, replacing the hydroxyl group with a halide forms acyl halides like acetyl chloride, and substitution with an amino group gives amides such as acetamide and cyclic amides like caprolactam. Similarly, replacing the hydroxyl group with an alkoxy group yields esters such as methyl acetate and cyclic esters like caprolactone. Furthermore, substitution with an acyloxy group forms acid anhydrides like acetic anhydride and cyclic analogues like succinic anhydride. Thus, each derivative contains an acyl group attached to a heteroatom. However, nitriles are also classified as carboxylic acid derivatives, although they lack an acyl group. Instead, they contain a cyano group where a carbon atom is triply bonded to a nitrogen atom, such as acetonitrile.