CHEM-263 · Lesson 10 of 12 · 24 min

Carboxylic acids and their derivatives: nucleophilic acyl substitution

▶ Video coming soon A video version of this lesson is on the way.

Carboxylic acids, RCO₂H, carry the carboxyl group, a carbonyl and a hydroxyl on the same carbon. They are the acids of everyday life: acetic acid in vinegar, citric acid in lemons, lactic acid in sour milk and tired muscles, and the long-chain fatty acids of fats and soaps. Replacing the OH of an acid with another group gives the carboxylic acid derivatives: acid chlorides, anhydrides, thioesters, esters and amides, and, at the same oxidation level, nitriles. Esters give fruits their smells and form polyesters; amides join the amino acids of proteins and the monomers of nylon. All of these compounds share one reaction, nucleophilic acyl substitution, in which a nucleophile replaces the group attached to the carbonyl. This lesson explains the acidity of carboxylic acids, the mechanism of acyl substitution, the order of reactivity of the derivatives and how to convert one into another.

Naming and structure

Carboxylic acids are named by replacing the -e of the alkane with -oic acid: ethanoic acid (acetic acid), butanoic acid (butyric acid, the smell of rancid butter), and benzoic acid for C₆H₅CO₂H. Their salts are carboxylates: sodium acetate, potassium benzoate. Esters are named as alkyl carboxylates, the alcohol part first: ethyl acetate, methyl benzoate. Acid chlorides become -oyl chlorides (ethanoyl or acetyl chloride), anhydrides take the acid name with anhydride (acetic anhydride), and amides take -amide (acetamide, N,N-dimethylformamide). Nitriles, R–C≡N, are named with -nitrile: ethanenitrile is acetonitrile.

Carboxylic acids form strong hydrogen bonds, and in the gas phase and in nonpolar solvents they exist largely as cyclic dimers held by two hydrogen bonds. Their boiling points are higher than those of alcohols of similar mass: acetic acid boils at 118 °C, propan-1-ol at 97 °C.

Acidity

Carboxylic acids are much stronger acids than alcohols. Acetic acid has a pKa of 4.76 and ethanol about 16. The difference comes from the carboxylate anion, whose negative charge is shared equally between two oxygens by resonance; both C–O bonds of acetate are 127 pm long, as CHEM-261 lesson 2 showed. Inductive effects tune the acidity further. Electron-withdrawing groups near the carboxyl group stabilize the anion: chloroacetic acid has a pKa of 2.87, dichloroacetic 1.35, trichloroacetic 0.66 and trifluoroacetic about 0.2. The effect falls off quickly with distance, as the chlorobutanoic acids of CHEM-261 lesson 4 showed. Benzoic acid, pKa 4.20, is slightly stronger than acetic acid, and its substituted derivatives define the Hammett σ constants of lesson 4.

At the pH of blood, 7.4, carboxylic acids are almost completely ionized: the ratio of acetate to acetic acid is 10^(7.4 − 4.76), about 440 to 1. This is why fatty acids and amino acids exist in the body as carboxylate ions, and why carboxylic acids can be separated from neutral organic compounds by extracting them into aqueous sodium bicarbonate and recovering them by acidifying.

Nucleophilic acyl substitution

All the reactions of acid derivatives follow one pattern. A nucleophile adds to the carbonyl carbon, forming a tetrahedral intermediate, exactly as in the additions of lesson 7. Here, however, the intermediate carries a leaving group, Y. The intermediate collapses, the C=O bond re-forms and Y⁻ is expelled. The overall result is substitution of Y by the nucleophile, by addition followed by elimination. It is not SN2: the nucleophile does not displace Y in one step from the back side, but adds to the π bond first.

\[\mathrm{R{-}CO{-}Y + Nu^- \longrightarrow [R{-}C(O^-)(Y)(Nu)] \longrightarrow R{-}CO{-}Nu + Y^-}\]

Whether a given substitution is favorable depends on the leaving group. A good leaving group is a weak base, the conjugate base of a strong acid. Chloride (HCl, pKa about −7) leaves easily; carboxylate (pKa about 4.8) less so; thiolate (pKa about 10), alkoxide (about 16) and amide ion (about 38) progressively less. A second factor is resonance donation from Y to the carbonyl. The lone pair on nitrogen in an amide donates strongly into the C=O, which stabilizes the amide and makes its carbonyl carbon less electrophilic; chlorine donates hardly at all. Both factors give the same order of reactivity:

Reactivity of carboxylic acid derivatives
DerivativeLeaving grouppKa of conjugate acidReactivity
Acid chloride, RCOClCl⁻about −7most reactive
Anhydride, (RCO)₂ORCO₂⁻about 4.8very reactive
Thioester, RCOSR′R′S⁻about 10reactive
Ester, RCO₂R′R′O⁻about 16moderate
Carboxylic acid, RCO₂HHO⁻ (after protonation, H₂O)about 15.7moderate (needs acid catalysis)
Amide, RCONR′₂R′₂N⁻about 38least reactive
Carboxylate, RCO₂⁻O²⁻ (not a leaving group)—unreactive to nucleophiles

The order has a simple practical consequence: a more reactive derivative can be converted into a less reactive one by treating it with the right nucleophile, but not the reverse. Acid chlorides react with carboxylates to give anhydrides, with alcohols to give esters and with amines to give amides. Anhydrides give esters and amides. Esters give amides. Amides do not give esters or acid chlorides under nucleophilic conditions; converting them back requires hydrolysis to the acid first. Every derivative can be hydrolyzed by water, with acid or base, to the carboxylic acid.

A reactivity ladder of carboxylic acid derivatives from acid chloride at the top through anhydride, thioester, ester and carboxylic acid to amide at the bottom, with the pKa of each leaving group's conjugate acid beside it. Downward arrows show conversions that are possible with the appropriate nucleophile, for example acid chloride to ester with an alcohol and ester to amide with an amine. Beside the ladder is the general addition–elimination mechanism through the tetrahedral intermediate.
The reactivity ladder: more reactive derivatives convert into less reactive ones

Making and using acid chlorides and anhydrides

Acid chlorides are made from carboxylic acids with thionyl chloride, SOCl₂, which converts the OH into a good leaving group and releases SO₂ and HCl as gases, or with oxalyl chloride. They are the most reactive derivatives and are used to make all the others, usually with a weak base such as pyridine or triethylamine to absorb the HCl formed. They react violently with water, give off HCl in moist air and must be handled in a fume hood. Anhydrides are milder and are often used instead: acetic anhydride is the usual acetylating agent, used industrially to make cellulose acetate for fibers and film. Structurally, aspirin is itself an acetate ester, of the phenol group of salicylic acid.

Esters

Esters can be made directly from a carboxylic acid and an alcohol with an acid catalyst, the Fischer esterification reported by Emil Fischer and Arthur Speier in 1895. Acid protonates the carbonyl oxygen, the alcohol adds, a proton is transferred, water leaves and the protonated ester loses a proton. Every step is reversible, and the equilibrium constant is modest, about 4 for acetic acid and ethanol, so equal amounts of acid and alcohol give only about two thirds conversion. Using the alcohol as the solvent or removing water drives the equilibrium toward the ester. Isotopic labeling with ¹⁸O shows that the oxygen of the alcohol ends up in the ester and the oxygen of the acid's OH ends up in the water, as the addition–elimination mechanism requires.

Many esters are flavor and fragrance compounds. Isoamyl acetate, 3-methylbutyl acetate, smells of bananas and is also an alarm pheromone of honeybees; ethyl butanoate smells of pineapple, octyl acetate of oranges, methyl anthranilate of grapes and methyl salicylate of wintergreen. Flavor chemists blend such esters with aldehydes and ketones to imitate fruit aromas, and the same esters are made by yeast during fermentation, giving beers and wines part of their fruitiness.

Esters are hydrolyzed by aqueous acid in the reverse of the Fischer esterification, and by aqueous base in an irreversible reaction called saponification. In base, hydroxide adds to the carbonyl, alkoxide is expelled, and the carboxylic acid formed is immediately deprotonated by the alkoxide or by hydroxide to a carboxylate, which cannot react further. That final acid–base step makes saponification irreversible and means a full equivalent of base is used up. The word comes from soap making: fats and oils are triesters of glycerol with long-chain fatty acids, triglycerides, and boiling them with sodium hydroxide gives glycerol and sodium salts of the fatty acids, which are soaps. Soap molecules have a charged carboxylate head and a long hydrocarbon tail and form micelles that carry grease into water.

Transesterification exchanges one alcohol for another. Vegetable oils treated with methanol and a base catalyst give glycerol and fatty acid methyl esters, which are biodiesel. In the United States, most biodiesel is made from soybean oil, with smaller amounts from canola and recycled cooking oil.

Esters are reduced by LiAlH₄ to two alcohols, as lesson 5 showed, and react with two equivalents of a Grignard reagent to give tertiary alcohols. Diisobutylaluminium hydride, DIBAL-H, at −78 °C stops at the aldehyde stage, because the tetrahedral intermediate is stable at that temperature and only collapses during the workup.

Worked problem

Fischer esterification equilibrium

For acetic acid + ethanol ⇌ ethyl acetate + water, K = 4.0. Calculate the fraction of acetic acid converted when 1 mol of acid reacts with (a) 1 mol of ethanol, (b) 10 mol of ethanol.

Show solution
  1. Let x mol of ester form. K = x² / ((1 − x)(n − x)), where n is the moles of ethanol.
  2. (a) n = 1: x²/(1 − x)² = 4, so x/(1 − x) = 2 and x = 2/3 ≈ 0.67.
  3. (b) n = 10: solve x² = 4(1 − x)(10 − x), that is 3x² − 44x + 40 = 0. The root below 1 is x = (44 − √(1936 − 480))/6 = (44 − 38.16)/6 ≈ 0.97.

Answer: (a) about 67 parts per hundred; (b) about 97. A large excess of alcohol drives the equilibrium toward the ester.

Amides

Amides are the most stable acid derivatives. The nitrogen lone pair is delocalized into the carbonyl, giving the C–N bond partial double-bond character: it is 133 to 134 pm long, shorter than a normal C–N single bond of 147 pm, and rotation about it is slow, with a barrier of about 75 kJ/mol. The amide group is therefore planar. In proteins, that planarity rigidifies the backbone and, with hydrogen bonds between the N–H of one amide and the C=O of another, produces the α-helices and β-sheets of protein structure. Because the lone pair is tied up, amides are very weak bases, protonating on oxygen rather than nitrogen, and amide N–H bonds are weakly acidic, about pKa 17 for primary amides.

Amides are made from acid chlorides or anhydrides and amines, or from esters and amines. Heating a carboxylic acid with an amine first forms an ammonium carboxylate salt, which loses water only at high temperature; in the laboratory, coupling reagents such as carbodiimides activate the acid instead, the method used to join amino acids in peptide synthesis. Amides are hydrolyzed only by prolonged heating with strong acid or base. The stability of the peptide bond is essential to life: at neutral pH and room temperature its uncatalyzed half-life is estimated at hundreds of years, and protease enzymes are needed to break it.

Amides are reduced by LiAlH₄ not to alcohols but to amines, because the nitrogen is a poor leaving group: the oxygen is removed instead, by way of an iminium ion. Lesson 11 uses this reaction to make amines.

Polyesters and polyamides

Reacting a molecule with two acid groups and a molecule with two alcohol or two amine groups builds a chain by repeated acyl substitution, a step-growth polymerization. Wallace Carothers at DuPont made nylon-6,6 in 1935 from hexanedioic acid (adipic acid, six carbons) and hexane-1,6-diamine (six carbons), hence the name; its amide links hydrogen bond between chains, giving a strong fiber that replaced silk in stockings and parachutes. Nylon-6, from the ring-opening of caprolactam, is the other major nylon. Poly(ethylene terephthalate), PET, the polyester of drink bottles and fleece, is made from terephthalic acid and ethane-1,2-diol. Kevlar is an aromatic polyamide whose rigid, flat chains align into fibers stronger than steel by weight. Because esters and amides can be hydrolyzed, these polymers can in principle be broken back down to monomers, the basis of chemical recycling of PET by methanolysis or glycolysis, a growing industry.

Nitriles

Nitriles have their carbon at the same oxidation level as carboxylic acids and behave as acid derivatives. They are made by SN2 reaction of cyanide with primary alkyl halides, adding one carbon to the chain. They are hydrolyzed by hot aqueous acid or base, through an amide, to carboxylic acids; reduced by LiAlH₄ to primary amines, RCH₂NH₂; and attacked by Grignard reagents to give, after hydrolysis, ketones. Acetonitrile is a common polar aprotic solvent, and the industrial hydrogenation of adiponitrile, NC(CH₂)₄CN, makes the hexane-1,6-diamine for nylon-6,6.

import math

# 1. reactivity order from leaving-group conjugate acid pKa
derivs = {'acid chloride': -7.0, 'anhydride': 4.8, 'thioester': 10.0,
          'ester': 16.0, 'amide': 38.0}
order = sorted(derivs, key=derivs.get)
print('reactivity, most to least:', ' > '.join(order))

def can_convert(a, b):
    """A derivative converts directly to one lower on the ladder (weaker base leaves)."""
    return derivs[a] < derivs[b]

for a, b in (('acid chloride', 'ester'), ('ester', 'amide'), ('amide', 'ester'), ('anhydride', 'amide')):
    print(f'  {a:13s} -> {b:6s}: {"yes" if can_convert(a, b) else "no (go through the acid)"}')

# 2. Fischer esterification: K = x^2 / ((a - x)(b - x)); solve for x
def fischer(K, acid, alcohol, water_removed=False):
    if water_removed:
        return min(acid, alcohol)
    A, B, C = K - 1, -K * (acid + alcohol), K * acid * alcohol
    disc = math.sqrt(B * B - 4 * A * C)
    return min(r for r in ((-B - disc) / (2 * A), (-B + disc) / (2 * A)) if 0 <= r <= min(acid, alcohol))

for n in (1, 2, 5, 10, 20):
    x = fischer(4.0, 1.0, float(n))
    print(f'acetic acid 1 mol + ethanol {n:2d} mol: ester {x:.3f} mol')
print('with water removed:', fischer(4.0, 1.0, 1.0, True), 'mol')

# 3. ionization of carboxylic acids at pH 7.4 and pH 2
for name, pka in (('acetic', 4.76), ('chloroacetic', 2.87), ('trifluoroacetic', 0.2), ('benzoic', 4.20)):
    r74 = 10 ** (7.4 - pka); r2 = 10 ** (2.0 - pka)
    print(f'{name:16s} pKa {pka:5.2f}  [A-]/[HA] at pH 7.4 = {r74:9.3g}, at pH 2 = {r2:7.3g}')

# 4. saponification: mass of NaOH to saponify 100 g of a triglyceride (glyceryl trioleate)
M_triolein, M_NaOH = 885.4, 40.0
print(f'NaOH for 100 g triolein: {100 / M_triolein * 3 * M_NaOH:.1f} g')
Output
reactivity, most to least: acid chloride > anhydride > thioester > ester > amide
  acid chloride -> ester : yes
  ester         -> amide : yes
  amide         -> ester : no (go through the acid)
  anhydride     -> amide : yes
acetic acid 1 mol + ethanol  1 mol: ester 0.667 mol
acetic acid 1 mol + ethanol  2 mol: ester 0.845 mol
acetic acid 1 mol + ethanol  5 mol: ester 0.945 mol
acetic acid 1 mol + ethanol 10 mol: ester 0.974 mol
acetic acid 1 mol + ethanol 20 mol: ester 0.987 mol
with water removed: 1.0 mol
acetic           pKa  4.76  [A-]/[HA] at pH 7.4 =       437, at pH 2 = 0.00174
chloroacetic     pKa  2.87  [A-]/[HA] at pH 7.4 =  3.39e+04, at pH 2 =   0.135
trifluoroacetic  pKa  0.20  [A-]/[HA] at pH 7.4 =  1.58e+07, at pH 2 =    63.1
benzoic          pKa  4.20  [A-]/[HA] at pH 7.4 =  1.58e+03, at pH 2 = 0.00631
NaOH for 100 g triolein: 13.6 g

The program confirms the ladder and the Fischer calculation: one equivalent of ethanol gives two thirds conversion, ten equivalents about 97 per hundred. At pH 2, acetic acid is almost entirely in the un-ionized form and can be extracted into an organic solvent, while at pH 7.4 it is over 99 per hundred carboxylate. The saponification figure, about 13.6 g of sodium hydroxide per 100 g of fat, is close to the saponification values soap makers look up for olive oil.

Common mistakes

  • MistakeNucleophilic acyl substitution is an SN2 reaction.

    InsteadIt is addition to the carbonyl followed by elimination of the leaving group, through a tetrahedral intermediate.

  • MistakeAn amide can be converted directly into an ester with an alcohol.

    InsteadAmides are less reactive than esters; hydrolyze to the acid first, then esterify.

  • MistakeSaponification is reversible like Fischer esterification.

    InsteadThe carboxylate formed in base cannot be attacked by alkoxide, so saponification goes to completion.

  • MistakeLiAlH₄ reduces amides to alcohols.

    InsteadIt reduces amides to amines, removing the oxygen.

  • MistakeEqual amounts of acid and alcohol give complete esterification.

    InsteadWith K about 4, conversion is only about two thirds unless excess alcohol is used or water removed.

  • MistakeCarboxylic acids are acidic because the O–H bond is weak.

    InsteadThe carboxylate charge is delocalized over two oxygens by resonance.

Summary and key terms

  • Carboxylic acids (pKa about 4 to 5) are far more acidic than alcohols because the carboxylate is resonance-stabilized; withdrawing groups increase acidity.
  • Acid derivatives react by nucleophilic acyl substitution: addition to the C=O, then loss of the leaving group from the tetrahedral intermediate.
  • Reactivity: acid chloride > anhydride > thioester > ester ≈ acid > amide; more reactive derivatives convert to less reactive ones.
  • Fischer esterification is an acid-catalyzed equilibrium (K about 4); saponification of esters by base is irreversible and makes soap from fats.
  • Amides are planar and stable because of N lone-pair delocalization; they are reduced by LiAlH₄ to amines.
  • Step-growth polymerization by acyl substitution makes nylons and polyesters; nitriles are hydrolyzed to acids and reduced to amines.
Carboxyl group
The –CO₂H group of carboxylic acids.
Acyl group
The R–C=O unit transferred in acyl substitution.
Nucleophilic acyl substitution
Replacement of the leaving group on an acyl carbon by a nucleophile, through a tetrahedral intermediate.
Fischer esterification
Acid-catalyzed formation of an ester from a carboxylic acid and an alcohol.
Saponification
Base-promoted hydrolysis of an ester to a carboxylate and an alcohol.
Transesterification
Exchange of the alcohol part of an ester for another alcohol.
Step-growth polymerization
Polymer formation by repeated reaction of difunctional monomers.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Give the product of acetyl chloride with (a) water, (b) ethanol and pyridine, (c) two equivalents of dimethylamine, (d) sodium acetate.

    Show answer

    (a) Acetic acid + HCl; (b) ethyl acetate; (c) N,N-dimethylacetamide plus dimethylammonium chloride; (d) acetic anhydride.

  2. Explain why two equivalents of amine are used to make an amide from an acid chloride.

    Show answer

    One equivalent forms the amide; the second neutralizes the HCl produced, which would otherwise protonate the amine and stop it acting as a nucleophile.

  3. Rank in order of acidity: acetic acid, dichloroacetic acid, ethanol, phenol.

    Show answer

    Dichloroacetic (1.35) > acetic (4.76) > phenol (10.0) > ethanol (16).

  4. Show a synthesis of isoamyl acetate and state how to drive it to completion.

    Show answer

    3-Methylbutan-1-ol + acetic acid with H₂SO₄ catalyst (Fischer esterification); use excess acetic acid or remove water. Alternatively, the alcohol with acetic anhydride.

  5. What two monomers react to form nylon-6,6, and what small molecule is lost if the diacid itself is used?

    Show answer

    Hexanedioic (adipic) acid and hexane-1,6-diamine; water is lost at each amide bond.

  6. Predict the products of (a) propanenitrile with hot aqueous H₂SO₄; (b) propanenitrile with LiAlH₄, then water.

    Show answer

    (a) Propanoic acid (and ammonium ion); (b) propan-1-amine.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz