Preparation of Nitriles
Nitriles can be prepared by substitution reactions of alkyl halides with cyanide salts:

These are nucleophilic substitution reactions and we introduce the nitrile group by using the nucleophilicity of the cyanide ion. In a similar manner, aldehydes and ketones can be converted to cyanohydrin:

Another method of preparing nitriles is their dehydration by SOCl2, P2O5, and POCl3:

The reaction starts with a nucleophilic attack of the C=O oxygen which converts into a good leaving and is then eliminated in the following steps:

The last step is irreversible formed by loss of good leaving groups and entropy factors.
Chemical Properties of Nitriles
The nitrile is somewhat similar to carbonyl: an electronegative atom is connected to carbon via a π bond(s):

The polarized π bond allows for different nucleophilic additions such as hydride, water, organometallics, etc. So, let’s discuss here the most common reactions of nitriles that go via a nucleophilic addition to the C-N triple bond.
The Hydrolysis of Nitriles
Nitriles can be hydrolyzed to carboxylic acids in acidic aqueous solutions, and to carboxylate salts with base-catalyzed hydrolysis:

In both cases, the transformation consists of two main parts; conversion of the nitrile to an amide and hydrolysis of the amide to the corresponding carboxylic acid.
The acid-catalyzed hydrolysis of nitriles starts with the protonation of the nitrogen which activates the triple bond and allows for a nucleophilic addition of water. This forms an intermediate imidic acid which tautomerizes to the corresponding amide:

In the second part, the amide is hydrolyzed to a carboxylic acid by the mechanism we discussed earlier.
The base-catalyzed nitrile hydrolysis starts with a nucleophilic addition of the hydroxide ion to the C-N triple bond forming an intermediate with a negative charge on the nitrogen which quickly removes a proton transforming into an imidic acid which again tautomerizes to the intermediate amide. In the second part of the reaction, the amide is hydrolyzed to the corresponding carboxylic acid:

Conversion of Nitriles to Amides
One question you may be wondering is whether we could stop the hydrolysis of the nitrile at the amide.

The problem here is that nitriles are difficult to hydrolyze and it is done under harsh heated acidic or basic conditions. This makes stopping the hydrolysis of intermediate amides very difficult.
Some sources state that nitriles can be hydrolyzed to amides using milder conditions such as HCl at 40o and whether this is acceptable or not is ultimately up to your instructor. The fact is hydrolyzing nitriles to amides is not a straightforward strategy and there is/has been research going on to find suitable conditions to achieve this transformation. For example, in J. Org. Chem., Vol. 41, No. 23, 1976, it was reported that using tert-butanol as a solvent allows to stop the hydrolysis at the amide formation.

In J. Org. Chem. 2005, 70, 1926-1929, TFA or AcOH−H2SO4 acid mixture was used for indirect hydration of the nitrile to amide. So, instead of the water acting as a nucleophile and attacking the activated nitrile, TFA does so forming another imidic intermediate which is then hydrolyzed to the corresponding amide:

The Ritter Reaction for Converting Nitriles to Amides
This is a well-known name reaction which is not included in most undergraduate organic chemistry textbooks. However, the reaction is a nice collection of protonation, activation, nucleophilic attack, and hydrolysis, and it is probably a great summary of what you have covered in your class.
So, the idea here is that the nitrile acts as a nucleophile via the lone pair of the nitrogen. Notice, it is not the –CN ion as we have seen many times in nucleophilic substitution reactions. The electrophile is a carbocation that can be formed from an alkene, an alcohol, or an alkyl halide:

After the nucleophilic attack, the carbon-nitrogen triple bond is activated and a nucleophilic attack of water occurs as we have seen in the hydrolysis of nitriles. There is principally no difference in whether the nitrile is activated via protonation or alkylation. The nucleophilic addition of water forms an imidic acid intermediate which tautomerizes to the corresponding amide.
If none of the above-mentioned methods is not suitable, you can always opt for the safest option which is the hydrolysis of the nitrile to a carboxylic acid followed by a conversion to an amide.

The coupling of carboxylic acid with amines is carried out using a coupling agent such as DCC or EDC. These reactions are at times challenging too, so the alternative of converting the acid to acid chloride first is also shown in the synthetic scheme. Recall that acid chlorides are the most reactive derivatives of carboxylic acids, and they readily react with all types of nucleophiles including amines
LiAlH4 Reduction of Nitriles to Primary Amines
Nitriles can be reduced to primary amines when treated with LiAlH4 or to aldehydes when a milder reducing agent such as DIBAL is used.

The nitrile group is activated by a coordination of Li+ ion which facilitates the nucleophilic addition of hydride ion. This forms an imine salt which undergoes another nucleophilic addition by AlH3 producing a highly reactive derivative of an amine. Both N-Al and N-Li bonds in this derivative are very polar and quickly react with water forming the new N-H bonds of the primary amine:

You can read more about the reduction of nitriles with LiAlH4 here.
Reduction of Nitrile by DIBAL
DIBAL is a milder reducing agent than LiAlH4 and it can be used for selective reduction of esters and nitriles to aldehydes.
The reaction, again, starts with a hydride addition to the C-N triple bond forming an iminium anion. DIBAL is a bulky reducing agent and unlike LiAlH4 the second hydride addition does not occur due to steric hindrance and the iminium salt intermediate is hydrolyzed to the corresponding aldehyde:

More details about the hydrolysis of imines and enamines are covered here.
You may not need this in practice as an undergrad but let me mention that these reactions are nowhere near as smooth and ideal as they appear on paper. Very often, you may end up reducing these derivatives to alcohols and oxidizing them to aldehydes since DIBAL will do a complete reduction as LiAlH4 does.
Reactions of Nitriles with Grignard and Organolithiums
Nitriles are converted to ketones when reacted with Grignard and Organolithium reagents:

The reactions are similar and they are not different from what we have learned about nucleophilic addition-elimination reactions of many carbonyl compounds. The electrophilic center here is the polarized C-N triple bond instead of the C-O double bond. Like in the reduction with DIBAL, only one equivalent of the nucleophile (carbon nucleophile here) adds to the triple bond forming an iminium intermediate which is hydrolyzed now to the corresponding ketone:

The mechanism is the same with organolithiums, so that is an exercise for you to try, and you can find the answer here.
These are the main reactions of nitriles I wanted to mention. Let me know in the comments if there is anything important missing.




