Amides
Amides can be ready from acid chlorides through nucleophilic substitution. Treatment along with ammonia provides a primary amide, treatment with a primary amine provides a secondary amide, and treatment with a secondary amine provides a tertiary amide. Tertiary amines cannot be employed in this reaction since they do not give a stable product.
Two equivalents of amine are needed for the above reactions because one equivalent of the amine is used up in creating a salt with the hydrochloric acid that is produced in the reaction. This is visibly wasteful on the amine, particularly if the amine is valuable. To prevent this, one equivalent of sodium hydroxide can be added to the reaction to neutralize the HCl.
Amides can as well be synthesized from acid anhydrides and esters, but generally these reactions offer no benefit over acid chlorides because acid anhydrides and esters are less reactive. Additionally, with acid anhydrides, half of the parent carboxylic acid is lost since the leaving group. This is wasteful and thus acid anhydrides are only employed for the synthesis of amides if the acid anhydride is cheap and available freely (for example acetic anhydride).
The synthesis of amides straight from carboxylic acids is not easy because the reaction of an amine with a carboxylic acid is a typical acid-base reaction resultant in the creation of a salt. Some salts can be transformed to an amide via heating strongly to expel water, but there are better methods available as previously explained.
Figure: Salt formation.