There are a couple of issues to address:
1. You raised the question about acid catalyzed reactions and the possible complication presented by protonation of the nucleophile (in this case, 4-aminopyridine), which renders this compound non-nucleophilic. In fact, there are two opposing effects that operate simultaneously: acid protonates the nucleophile as noted above and also protonates a C=O
C=OH
+, thereby rendering the substrate more electrophilic. As a result, these exists an optimum pH (may be different for each substrate-nucleophile combination) that offers the best balance between protonation of nucleophile (
bad!) vs. protonation of C=O in substrate (
good!).
A plot of reaction rate vs. pH is likely to appear as a bell-shaped curve (somewhat akin to a Boltzmann distribution).
2. With regard to conversion of an acid anhydride into the corresponding imide: Perhaps the conversion phthalic acid + NH
3 phthalimide offers a useful model system in this regard.
The following procedures appear online; (Reference:
http://www.sciencemadness.org/talk/viewthread.php?tid=6573)
* * *
Phthalimide:
Method 1. Place 100 g (0.675 mol) of phthalic anhydride and 105 mL of concentrated ammonia solution in a 1-litre round-bottomed flask fitted with a wide air condenser (10 mm in diameter). Heat on a sand bath, gradually at first until the mixture is in a state of quiet fusion and forms a homogeneous melt (the temperature reaches 300°C in about 1.5-2 hours; all the water is evaporatedduring the first hour). Shake the flask occasionally during the heating and push down any material whicj sublimes into the condenser with a glass rod. Pour the contents of the flask while still hot into a porcelain basin, allow to cool and grind to a fine powder in a mortar.
The phthalimide (95 g, 96%) is practically pure and melts at 233-234°C. It may be recrystallised from EtOH, but the solubility is only slight (about 5%).
Method 2. Intimately mix 99 g (0.67 mol) of pure phthalic anhydride and 20 g (0.33 mol) of urea, and placethe mixture in a 1-litre, long-necked, round-bottomed flask. Heat the flask in an oil bath at 130-135°C. When the contents have melte, effervescence commences and gradually increases in vigour; after 10-20 minutes, the mixture suddenly froths up to about three times the original volume (this is accompanied by rise in temperature to 150-160°C) and becomes almost solid. Remove the heat from beneath the bath and allow to cool. Add about 80 mL of water to disintegrate the solid in the flask, filter at the pump, wash with a little water and then dry at 100°C.
The yield of phthalimide, m.p. 233°C (i.e practically pure), is 86 g (87%). If desired, the phthalimide may be recrystallised from 1200 mL of industrial spirit; the first crop consists of 34 g of m.p 234°C, but further quantities may be recovered from mother-liquor.
Reference: VOGEL'S Textbook of Practical Organic Chemistry (5
th edition), pp 1065-1066.