In the previous section I showed that salts hydrolyze in the aqueous medium, generating acidic or basic media. Now we will calculate the pH of a 0.5 M aqueous solution of sodium cyanide.

The cyanide anion comes from a weak acid (HCN) and undergoes the following hydrolysis reaction:

$CN^- + H_2O \rightleftharpoons HCN + OH^-$

As can be seen, the hydrolysis reaction generates hydroxide ions and will produce a basic pH.

The constant of this reaction ($K_H$) can be obtained by dividing the water constant $K_w$ by the acidity constant of hydrocyanic acid $K_a$

\begin{equation}K_H=\frac{K_w}{K_a}=\frac{10^{-14}}{6.2x10^{-10}}=1.6x10^{-5}\end{equation}

The rest of the exercise is common to calculating pH in a weak acid solution.

$CN^- + H_2O \rightleftharpoons HCN + OH^-$

0.5 - x x x

\begin{equation}K_H=\frac{[HCN][OH^-]}{[CN^-]}=\frac{x^2}{0.5-x}=1.6x10^{-5}\end{ equation}

$x=[OH^-]=2.8x10^{-3}\;M$

$pOH=-log[OH^-]=2.55$

$pH=14-pOH=11.45$