How do I solve this Ionic Equilibrium problem?

**Problem :** 



> 
> Equal volumes of $\pu{0.02M}$ $\ce{AgNO3}$ and $\pu{0.02M}$ $\ce{HCN}$ were mixed. Calculate
>  $\ce{[Ag+]}$ at equilibrium assuming no cyano-complex formation.
>  $K\_{sp}(\ce{AgCN})= \pu{2.2\times10^{-16}}$, $K\_{a}(\ce{HCN})=\pu{6.2\times10^{-10}}$
> 
> 
> 


**My solution:**  

Concentration of $\ce{AgNO3}$ and $\ce{HCN}$ before reacting when mixed will become $\pu{0.01M}$. Since $\ce{AgNO3}$ is a strong electrolyte it dissociates completely. So, initial concentration $[Ag^+]$ is $\pu{0.01M}$.
$$\ce{HCN<=>H+ + CN-} $$
After reaction let 
$[\ce{HCN}]= \pu{0.01-x}$, $[\ce{H+}]=\pu{x}$, $[\ce{CN-}]=\pu{x}$.  

Now $\ce{CN-}$ reacts with $\ce{Ag+}$
$$\ce{Ag+ + CN^-<=> AgCN}$$
Initial $[\ce{Ag+}] = \pu{0.01}$, $[CN^-]=\pu{x}$.  

After reaction let $[\ce{Ag+}] = \pu{0.01-y}$, $[\ce{CN-}]=\pu{x-y}$, $[\ce{AgCN}] = \pu{y}$.  

Now, $K\_{a}(\ce{HCN})=\pu{6.2\times10^{-10}}= \frac{[\ce{H+}][\ce{CN-}]}{[\ce{HCN}]}=\frac{x(x-y)}{0.01-x}\approx\frac{x(x-y)}{0.01} $.  

And $K\_{sp}(\ce{AgCN})=\pu{2.2\times10^{-16}} = [\ce{Ag+}][\ce{CN-}] = (0.01-y)(x-y)$.  

Solving these two equations I get $\pu{(0.01-y)= 8.9\times10^{-11}=[\ce{Ag+}]}$.  

But the solution in my book says the answer is $\pu{5.9\times10^{-5}}$.  

I don't where am I going wrong. 




**Chemistry**


AgNO3 is a strong electrolyte it dissociates completely.


$\ce{AgNO3 -> Ag+ + NO3-}$


If it was just HCN in solution, then most of the $\ce{CN^-}$ species would be as HCN. But since $\ce{AgCN}$ precipitates, more HCN dissociates. So essentially the overall reaction is:


$\ce{HCN + Ag+ -> AgCN}\,\ce{v + H+}$


The $K\_{sp}$ of $\ce{AgCN}$ is such that it is reasonable to assume that for all practical purposes that the precipitation is essentially complete.


Assumptions
-----------


(1) I assume that the correct answer should have two significant figures which are all that the equilibrium constants have. However I will carry 4 significant figures in the intermediate calculations to try to avoid significant rounding errors.


(2) $\ce{[H^+]} \approx 0.01000$ molar and $\approx 0.01000\ \mathrm{moles}\ \ce{AgCN}\ \text{ppt per liter of the mixture}$ (In other words about 1 ppt error for both)


**Mass balance**


If we consider 1 liter of the mixture of solution then we also have the following two mass balance equations:



> 
> The volume doesn't matter. Thinking of it as 1 liter just makes it simpler to get to the final result.
> 
> 
> 


$0.01000 = \ce{[CN-] + [HCN]} +\ \mathrm{moles\ \ce{AgCN}\ce{v}\tag{1}}$


$0.01000 = \ce{[Ag+] +\ \mathrm{moles}\ \ce{AgCN}\ce{v}\tag{2}}$


$\therefore \ce{[Ag+] = [CN-] + [HCN]}\tag{3} $


**Equilibrium equations**


$K\_{a}(\ce{HCN})=\pu{6.2\times10^{-10}}= \dfrac{[\ce{H+}][\ce{CN-}]}{[\ce{HCN}]}\tag{4}$


$K\_{sp}(\ce{AgCN})=\pu{2.2\times10^{-16}} = [\ce{Ag+}][\ce{CN-}]\tag{5}$


dividing (4) by (5) we can get:


$2.819\times10^6 = \dfrac{\ce{[H+]}}{\ce{[Ag+][HCN]}}\tag{6}$


Rearranging (6) and substituting $\ce{[H+] = 0.01000\ \mathrm{molar}}$


$\ce{[HCN] =}\dfrac{3.547\times10^{-9} }{\ce{[Ag+]}}\tag{7}$


Rearranging (5) we get:


$\ce{[CN-]} = \dfrac{\pu{2.2\times10^{-16}}}{\ce{[Ag+]}}\tag{8}$


Substituting (7) and (8) into (3) we get:


$\ce{[Ag+] =} \dfrac{\pu{2.2\times10^{-16}}}{\ce{[Ag+]}} + \dfrac{3.547\times10^{-9} }{\ce{[Ag+]}}\tag{9} $


Solving:


$\ce{[Ag+]^2} \approx 3.547\times10^{-9}\tag{10} $


$\ce{[Ag+] =} 5.955 \times10^{-5}\tag{11}$


**Rounding to two places...** $\ce{[Ag+] =} 6.0 \times10^{-5}$


Solving for other species
-------------------------


Substituting for $\ce{[Ag+]}$ in (8) gives


$\ce{[CN-]} = \dfrac{\pu{2.2\times10^{-16}}}{5.955 \times10^{-5}} = 3.694\times 10^{-12}\tag{12}$


Substituting for $\ce{[Ag+]}$ in (7) gives


$\ce{[HCN] =}\dfrac{3.547\times10^{-9} }{5.955 \times10^{-5}} = 5.956\times10^{-5}\tag{13}$


Argentocyanide Complex
----------------------


The problem has ignored the argentocyanide complex. Is that reasonable?


$K = 5.6\times10^{18} =\dfrac{\ce{[Ag(CN)2^-]}}{\ce{[Ag+][CN-]^2}}\tag{15}$


rearranging


$\ce{[Ag(CN)2^-]} = \ce{[Ag+][CN-]^2}\times(5.6\times10^{18})=4.794\times10^{-9}\tag{16}$


So it is reasonable to ignore the additional complication.


Checking
--------



> 
> 
> > 
> > **You always check your assumptions on this sort of problem. It is easy to go down the wrong rabbit hole.**
> > 
> > 
> > 
> 
> 
> 


**with** $K\_\mathrm{a}\ce{(HCN)}$


$\pu{6.2\times10^{-10}} = \dfrac{[\ce{H+}][\ce{CN-}]}{[\ce{HCN}]} = \dfrac{(0.01)(3.694\times 10^{-12})}{5.956\times10^{-5}} = 6.202\times10^{-10}\tag{14}$


**mass balance**


It makes sense chemically that in the acidic solution $\ce{[HCN]} \gg \ce{[CN-]}$ so that $\ce{[Ag+]} \approx \ce{[HCN]}$. Making that assumption earlier using equation (6) would have reduced the work for this problem.


**[H+] = 0.01000 molar and 0.01000 moles AgCN ppt per liter of the mixture**


Also assuming that $\ce{[H^+] = 0.01000\ \mathrm{molar}}$ is certainly correct to two significant figures. However I tried to carry 4 significant figures in the intermediate calculations to avoid rounding errors. The assumption isn't that good.


**!! PROBLEM !!**


The assumptions that:  
 $\quad\quad\ce{[H^+]} \approx 0.01000$ molar  
 $\quad\quad\approx 0.01000\ \mathrm{moles}\ \ce{AgCN}\ \text{ppt per liter of the mixture}$  

are not good to 4 significant figures. It would have been better to use:  

$\quad\quad\ce{[Ag+]} \approx \ce{[HCN]}$  

$\quad\quad\ce{[H^+] \approx 0.01000 - [HCN] \approx 0.010000 -[Ag+]}$  

and get a quadratic equation when simplifying equation (6). Then $\ce{[Ag+]} = 5.938\times10^{-5}$ and $\ce{[H+]} = 9.941\times10^{-3}$.


So the value $\ce{[Ag+]} = 5.956\times10^{-5}$ is off by +0.303%, or 3 ppt, which I think is acceptable, but it is marginal.


 3

Complete Analysis
-----------------


To beat this to death perhaps here is a more complete analysis:


Assumptions
-----------


(1) Assume that the correct answer should have two significant figures (which are all that the equilibrium constants have) but carry 4 significant figures in the intermediate calculations to try to avoid significant rounding errors.


(2) AgNO3 is a strong electrolyte it dissociates completely.


$\ce{AgNO3 -> Ag+ + NO3-}$


Thus the $\ce{[NO3^-]}$ can be assumed to be exactly 0.010000 molar.


(3) $\ce{Ag(CN)}$ is very insoluble. So the reaction should produce about 0.01 molar $\ce{H+}$ and about 0.01 moles of $\ce{Ag(CN)}$ per liter of solution.


(4) In a fairly acid solution the remaining cyanide species in solution will be mostly $\ce{HCN}$ with very little $\ce{CN^-}$.


Equations
---------


**Equilibrium equations**


$K\_{a}(\ce{HCN})=\pu{6.2\times10^{-10}}= \dfrac{[\ce{H+}][\ce{CN-}]}{[\ce{HCN}]}\tag{E1}$


$K\_{sp}(\ce{AgCN})=\pu{2.2\times10^{-16}} = [\ce{Ag+}][\ce{CN-}]\tag{E2}$


dividing (E1) by (E2) gives another equation, but only two of the three equilibrium equations will be independent.


$2.818\times 10^6 = \dfrac{\ce{[H+]}}{\ce{[Ag+][HCN]}}\tag{E3}$


**Mass Balance equations**


In order to balance charges in the remaining solution:


$$\ce{[Ag^+] + [H^+] = [NO3^-] + [CN^-] }$$


but since $\ce{NO3^-} =0.01000$


$$\ce{[Ag^+] + [H^+] = 0.01000 + [CN^-]\tag{M1}}$$


To mass balance $\ce{CN^-}$ for some volume, V, we have:


$$0.01000V = \ce{[CN-]V + [HCN]V} +\ \mathrm{moles(\ce{AgCN}\ce{v})}$$


To mass balance $\ce{Ag^+}$ for some volume, V, we have:


$$0.01000V = \ce{[Ag+]V} +\ \mathrm{moles(\ce{AgCN}\ce{v})}$$


Subtracting B5 from B4, rearranging, and then dividing by $\ce{V}$ gives:


$$\ce{[Ag+] = [CN-] + [HCN]}\tag{M2}$$


Now adding (M1) and (M2) we get (M3), but again only two of the three equations M1, M2 and M3 are independent.


$$\ce{[H^+] + [HCN] =0.01000}\tag{M3}$$


Unknowns
--------


There are five unknowns ( $\ce{[H+], [Ag+], [HCN], [CN-], AgCN(s)}$ ) in the original system.


Manipulation of the mass balances for $\ce{CN^-}$ and $\ce{Ag^+}$ eliminated the $\ce{AgCN(s)}$ as a variable and left mass balance equation M2.


**Summary**


Now with two equations from E1, E2, and E3 and then two equations from M1, M2 and M3 there are 4 equations and 4 unknowns ( $\ce{[H+], [Ag+], [HCN], [CN-]}$ ) so an exact solution is possible. Rather than to try to tediously solve some messy polynomial equation by hand the idea is to use some notion of chemistry to simplify the equations so that the result can be obtained with at most solving a quadratic equation.


Of course to obtain a numerical solution by computer is possible regardless how messy the equations and the computer doesn't care how tedious the calculation is.


 3

Exact Solution
--------------


Starting with the [analysis](https://chemistry.stackexchange.com/a/87197/22102) noted for this problem, rearrange equation E1 to:


$K\_{a}\ce{[HCN]} = \ce{[H+][CN-]}\tag{E1}$ 


Now solve for each of the three unknowns in terms of $\ce{[Ag+]}$.


**$\ce{[CN-]}$ in terms of $\ce{[Ag+]}$.**


Just need to rearrange E2:


$\ce{[CN-]} = \dfrac{K\_{sp}}{\ce{[Ag+]}}\tag{E2}$


**$\ce{[H+]}$ in terms of $\ce{[Ag+]}$ using M1 and E2.**


\begin{align}\\
\ce{[H^+] &= 0.010000 + [CN^-] - [Ag^+]}\tag{M1}\\
\\
\ce{ &= 0.010000 + \dfrac{K\_{sp}}{\ce{[Ag+]}} - [Ag^+]}\\
\\
&=\dfrac{K\_{sp} + 0.010\ce{[Ag+] - [Ag+]^2}}{\ce{[Ag+]}}\\
\end{align}


**$\ce{[HCN]}$ in terms of $\ce{[Ag+]}$ using M2 and E2.**


\begin{align}\\
\ce{[HCN] &= [Ag+] - [CN-]}\tag{M2}\\
 \\
&= \ce{[Ag+]} - \dfrac{K\_{sp}}{\ce{[Ag+]}}\\
 \\
&= \dfrac{\ce{[Ag+]^2}-K\_{sp}}{\ce{[Ag+]}}\\
\end{align}


**Substituting gives**
$$K\_a \cdot\dfrac{\ce{[Ag+]^2}-K\_{sp}}{\ce{[Ag+]}} = \dfrac{K\_{sp} + 0.010\ce{[Ag+] - [Ag+]^2}}{\ce{[Ag+]}} \cdot \dfrac{K\_{sp}}{\ce{[Ag+]}}$$


**Final Equation**


One form of the final equation is given below. Of course multiplying and dividing by constant would yield other forms. 


Using any other combination of equations would yield an equivalent equation. 


$$ 0 = \dfrac{K\_a}{K\_{sp}}\ce{[Ag+]^3} + \ce{[Ag+]^2} - (K\_a+0.01)\ce{[Ag+]} - K\_{sp} $$


Numerical Solution
------------------


Solving with [WolframAlpha equation solver](https://www.wolframalpha.com/examples/EquationSolving.html) using:


$$\text{a==6.2`20e-10, b==2.2`20e-16, N[[(a/b)\*x^3+x^2-(a+0.01000)\*x-b=0],20]}$$


gives $\ce{[Ag+]} = 5.939\,118\,459\times10^{-5}$ as noted by user user6376297 in a comment under the OP's question. 


 1