Basicity of heterocyclic amines
When a nitrogen atom is incorporated directly into an aromatic ring, its basicity depends on the bonding context. In a pyridine ring, for example, the nitrogen lone pair occupies an sp2-hybrid orbital, and is not part of the aromatic sextet – it is essentially an imine nitrogen. Its electron pair is available for forming a bond to a proton, and thus the pyridine nitrogen atom is somewhat basic.
In a pyrrole ring, in contrast, the nitrogen lone pair is part of the aromatic sextet. This means that these electrons are very stable right where they are (in the aromatic system), and are much less available for bonding to a proton (and if they do pick up a proton, the aromic system is destroyed). For these reasons, pyrrole nitrogens are not strongly basic.
The aniline, pyridine, and pyrrole examples are good models for predicting the reactivity of nitrogen atoms in more complex ring systems (a huge diversity of which are found in nature). The tryptophan side chain, for example, contains a non-basic ‘pyrrole-like’ nitrogen, while adenine (a DNA/RNA base) contains all three types.
The lone pair electrons on the nitrogen of a nitrile are contained in a sp hybrid orbital. The 50% s character of an sp hybrid orbital means that the electrons are close to the nucleus and therefore not significantly basic.
A review of basic acid-base concepts should be helpful to the following discussion. Like ammonia, most amines are Brønsted and Lewis bases, but their base strength can be changed enormously by substituents. It is common to compare basicity’s quantitatively by using the pKa‘s of their conjugate acids rather than their pKb‘s. Since pKa + pKb = 14, the higher the pKa the stronger the base, in contrast to the usual inverse relationship of pKa with acidity. Most simple alkyl amines have pKa‘s in the range 9.5 to 11.0, and their water solutions are basic (have a pH of 11 to 12, depending on concentration). The first four compounds in the following table, including ammonia, fall into that category.
The last five compounds (colored cells) are significantly weaker bases as a consequence of three factors. The first of these is the hybridization of the nitrogen. In pyridine the nitrogen is sp2 hybridized, and in nitriles (last entry) an sp hybrid nitrogen is part of the triple bond. In each of these compounds (shaded red) the non-bonding electron pair is localized on the nitrogen atom, but increasing s-character brings it closer to the nitrogen nucleus, reducing its tendency to bond to a proton.