# Adding cyanide vs nitrite for nucleophilic substitution and why does it change when we use silver salts for it

On adding $$\ce{NaCN}$$ to $$\ce{RX}$$, we get

$$\ce{NaCN + RX -> RCN + NaX}$$

And not $$\ce{RNC}$$. Clayden gives the explanation as follows:

Although linear cyanide (which is isoelectronic with $$\ce{N2}$$) has a lone pair on nitrogen and a lone pair on carbon, the nucleophilic atom is usually anionic carbon rather than neutral nitrogen as the $$\mathrm{sp}$$ orbital on carbon is of higher energy than that on the more electronegative nitrogen, and therefore constitutes the HOMO.

So according to Clayden, Carbon being less electronegative, has a higher HOMO than Nitrogen, thus it's lone pair attack the LUMO, to form a bond as the less the difference in energy between HOMO and LUMO, the stronger is the bond

But when we consider the same case with $$\ce{NaNO2}$$, so according to Clayden, nitrogen being less electronegative than oxygen, Nitrogen should have a higher energy HOMO and thus in a nucleophilic substitution reaction it is from the nitrogen side, that the reaction should take place but ... $$\ce{NaNO2 + RX -> RONO + NaX}$$

The reaction takes place from the oxygen side. Why?

Also when we have the silver salts of them, e.g., $$\ce{AgCN}$$, the reaction becomes: $$\ce{AgCN + RX -> RNC + AgX}$$ Similarly, $$\ce{AgNO2 + RX -> RNO2 + AgX}$$

Why does it change?

• Mayr has a great monograph on this topic: onlinelibrary.wiley.com/doi/abs/10.1002/anie.201007100 – Zhe Jul 6 at 21:17
• I changed the title from "cyanide vs nitrile.." to "cyanide vs nitrite.." because I felt that's what you meant. Otherwise, cyanide and nitrile are same thing in organic chemistry. If you don't like my change, please feel free to switch it back to what you wish. – Mathew Mahindaratne Jul 6 at 21:52
• @NilayGhosh That one was from the book Peter Sykes. He had a completely different explanation. Now this is from Clayden. He know goes over the Molecular Orbital Theory to explain this question. Although the reaction is the same , I think the questions are different .... – RandomAspirant Jul 7 at 3:27
• Any answer that isn’t from the Mayr paper that @Zhe linked is probably wrong. – orthocresol Jul 7 at 5:05
• @orthocresol If I haven't already said it, thanks for directing me to that paper. – Zhe Jul 7 at 11:15

Potassium cyanide ($$\ce{KCN}$$) is a predominantly ionic compound ($$\ce{K+}$$ is Hard Acid while $$\ce{CN-}$$ is Soft base) and would dissociate completely to give cyanide ions in solution. Cyanide ion ($$\ce{CN-}$$) is considered an ambient nucleophile, which means that the negative charge can associate with either carbon or nitrogen. However, the negative charge of cyanide ion concentrated on carbon than nitrogen. Thus, reaction with haloalkanes yields cyanides (nitriles) since $$\ce{C-C}$$ bond is thermodynamically more stable than $$\ce{C-N}$$ bond (simplest explanation).
Silver cyanide ($$\ce{AgCN}$$) is largely covalent and it does not dissociate easily to give $$\ce{CN-}$$ due to soft-soft interaction ($$\ce{Ag+}$$ is Soft Acid and $$\ce{CN-}$$ is Soft base). Thus, negative charge of $$\ce{CN-}$$ ion is mostly available at nitrogen, and hence the attacking centre of the nucleophile will be $$\ce{N}$$-atom. As a result, you get nucleophiluc substitution of haloalkanes to give isocyanides (isonitrile).
Same argument can be given for nitrite formation with $$\ce{KNO2}$$ and nitro formation with $$\ce{AgNO2}$$. In this case, $$\ce{KNO2}$$ is a predominantly ionic compound ($$\ce{K+^-O-N=O}$$) where one of oxygen atoms of nitrite ion has negative charge. Therefore, the nucleophilic attack of $$\ce{NO2-}$$ on haloalkane would result alkyl nitrite ($$\ce{R-O-N=O}$$). Silver nitrite ($$\ce{AgNO2}$$) is, on the other hand, largely covalent and would not dissociate easily to give free $$\ce{NO2-}$$ ions. As a results, the lone pair on nitrogen acts as an attacking site, forming nitroalkanes (high electronegativity of oxygen compared to nitrogen prevented it from donating its lone pair, as explainnation given by Clayden).
• Sir, could you explain with the MOT part ?? Clayden says that in $\ce{K+ CN- }, attack from Carbon side occurs , because it being less negative has a higher HOMO. But with$\ce{K+ NO2- }, Nitrogen being less electronegative than oxygen , should have a higher energy HOMO , thus attack from Nitrogen side should happen..... But it does not. – RandomAspirant Jul 7 at 3:31
• That's because the negative charge of nitrite ion is on one of the oxygen atoms (see the resonance structure of $\ce{NO2-}$). Negative charge with a lone pair always wins vs just a lone pair. – Mathew Mahindaratne Jul 7 at 5:00