All carboxylic acid derivatives undergo nucleophilic acyl substitution reactions. These are addition–elimination reactions in which a nucleophile displaces the leaving group of an acyl derivative to form a different acyl derivative. The mechanism depends on the nature of the nucleophile and the leaving group. Generally, they exist as neutral species under acidic conditions and as relatively stable anions under basic conditions. The acid-catalyzed mechanism begins with the protonation of the carbonyl oxygen, rendering the carbonyl carbon more electrophilic. This is followed by a nucleophilic attack at the carbonyl carbon to form a tetrahedral intermediate. Next, deprotonation of the tetrahedral intermediate, followed by protonation of the leaving group, leads to the departure of the leaving group as a neutral species. A final proton transfer step yields the substitution product. Under basic conditions, the nucleophile attacks the carbonyl carbon, forming a tetrahedral alkoxide intermediate. Here, the leaving group departs as a relatively stable anion, giving the substitution product.