# How to calculate the pH of a solution with addition of a complex

The scenario is this. I have $$50$$ mL of $$0.1$$ M $$\ce{NH4^+}$$ at a certain temperature which gives it a $$K_a=5.2\times 10^{-8}$$. To this solution, I add $$0.02$$ moles of $$\ce{Cd(NO_3)_2}$$. It is known that cadmium ions undergo the following reaction: $$\ce{Cd^2+ + 4NH3 <=> [Cd(NH_3)_4]^2+}$$ which has an equilibrium constant $$K_f=7.3\times 10^{17}$$ at this temperature. Assuming no other reactions, I want to calculate the pH of the resulting solution.

The solution presented in the textbook goes as follows: They first find the equilibrium constant for the equilibrium $$\ce{Cd^2+ + 4NH_4^+ <=> 4H3O^+ + [Cd(NH_3)_4]^2+}$$ which is $$K_{eq} = (K_a)^4\times K_f = 5.3375\times10^{-12}$$. They have the initial amount of $$[\ce{Cd^2+}] = 0.4$$ M and $$[\ce{NH_4^+}] = 0.1$$ M. Then they let $$x$$ be the change in concentration and retrieved the following equilibrium expression: $$\frac{\left[\ce{[Cd(NH_3)_4]^2+}\right]\left[\ce{H3O^+}\right]^4}{\left[\ce{NH_4^+}\right]^4\left[\ce{Cd^2+}\right]} = \frac{x(4x)^4}{(0.4-x)(0.1-4x)^4}= 5.3375\times10^{-12}$$

Then by applying the small change assumption – where $$0.4-x = 0.4$$ and $$0.1-4x=0.1$$ – we get x = $$0.000556$$ M. This results in a pH = $$-\log{4x}= 2.65$$

My qualm is what happens if we do it this way: instead we try to find the equilibrium constant to $$\ce{Cd^2+ + 3NH3 + NH_4^+ <=> H_3O^+ +[Cd(NH_3)_4]^2+}$$ which is just the addition of the two reactions. This intuitively seems like more of an accurate depiction of what is going on but I'm not sure. This time the equilibrium constant is $$K_{eq}=K_a\times K_f = 3.796\times10^{10}$$. There's now a couple more steps. Using the $$K_a$$ we find the equilibrium concentration of $$\ce{NH_3}$$ in just the acid solution which will give us an initial value of $$[\ce{NH_3}] = 7.21\times 10^{-5}$$ M. We then take the the same initial for $$\ce{Cd^2+}$$ and decrease the ammonium one by the amount we just calculated for the sake of accuracy and we get the following expression: $$\frac{\left[\ce{[Cd(NH_3)_4]^2+}\right]\left[\ce{H3O^+}\right]}{\left[\ce{NH_3}\right]^3\left[\ce{Cd^2+}\right]\left[\ce{NH_4^+}\right]} = \frac{x\left(7.21\times10^{-5}+x\right)}{\left(7.21\times10^{-5}-3x\right)^3(0.4-x)(0.0999-x)}= 3.796\times10^{10}$$ This one isn't so easily solved on paper but when I plugged it into wolfram-alpha I got $$x=0.0000236$$ M as the only solution which results in no negative concentrations, giving a pH $$= -\log\left(x+7.21\times10^{-5}\right) = 4.02$$

These answers are two orders of magnitude apart from each other. Came anyone help clear up what is going on; which one (or maybe neither) is the more accurate way and why? Thank you!

• @Poutnik Yep, thank you for that, I'll edit it! Oct 3 at 7:51
• Perhaps, apply some formatting for easier reading and orientation. // For plain text formatting by StackExchange markdown, see as inspiration SE meta - formatting // SE meta - tables // Advanced formatting Oct 3 at 8:01
• You can always apply the universal method of solving the set of nonlinear equations for all equilibrii and mass and charge balances. :-) // The above solutions do not count with the initial H3O+ nor NH3. In my ballpark from head estimation the [NH3]init would be very roughly around 10^-5 mol/L. (0.1 M NH4+ and pH 5.25), comparable with $x$. Oct 3 at 8:40
• For such equation set solutions, it is advised to formally substitute variables by single-letter symbols for easier manipulation. Oct 3 at 8:50
• How did you get the initial [NH3]=7.21E-5 M? When I have calculated pH=0.5(pKb - log c) = 0.5(9.25 - log 0.1) = 5.12, so [H+]=[NH3] = 7.5E-6 M Oct 3 at 9:50

### The problem with solution 2

First, a quick calculation checking solution 2. If you plug in the claimed equilibrium concentrations for the second solution and calculate $$Q$$ for the ammonium dissociation, you will see that:

$$[\ce{H3O+}]=\pu{9.57E-5 M}$$ $$[\ce{NH3}]=\pu{1.3E-6 M}$$ $$[\ce{Cd^2+}]=\pu{0.4 M}$$ $$[\ce{NH4+}]=\pu{0.0999 M}$$

$$Q = \frac{\pu{1.3E-6} \cdot \pu{9.57E-5} }{0.0999} = \pu{1.2E-9}$$

Because $$Q$$ is smaller than the equilibrium constant, more ammonium will dissociate (which will mess up the other equilibrium). This means you have to solve the two equations simultaneously if you go down this path.

### Why solution 1 is the better strategy

There are three equilibria you have to satisfy. The complexation, the acid dissociation of ammonium, and the autodissociation of water.

Solving this with a single equation (instead of more than three, if you include mass balance) comes down to knowing major and minor species. As the correct solution shows you after the fact, you have a lot of free ammonium and cadmium, some hydronium and complex, and much less of ammonia and hydroxide. The first solution path uses an equilibrium equation that does not contain the minor species.

$$\ce{Cd^2+ +4NH4+ + 4H2O<=> 4H3O+ +[Cd(NH3)4]^2+}\tag{1}$$

Ignoring minor species (setting them to zero) does not introduce a large error (and you could iteratively fix that small error later - see answers from Poutnik for similar questions).

Let's look at the second solution path. The equilibrium you are focusing on is:

$$\ce{Cd^2+ +3NH3 +NH4+ + H2O<=> H3O+ +[Cd(NH3)4]^2+}\tag{2}$$

You calculate the concentration of the species before adding cadmium, ensuring that all but reaction (2) is at equilibrium. However, as reaction (2) goes forward, it consumes ammonia and ammonium, and produces hydronium, so that the acid dissociation equilibrium of ammonium is now out of equilibrium. As shown above, more ammonium would dissociate into ammonia, which would then form more complex.

### How would you know before you try both?

We know that free cadmium will be a major species (in excess). We know that the solution will be acidic (some ammonia will dissociate), so there will be more (free) ammonium than ammonia. In fact, the pH would have to be higher than 7.3 for there to be more ammonia than ammonium. The reason that adding the cadmium lowers the pH is that it depletes ammonia, allowing more ammonium to dissociate (Le Chatelier's principle, if you will). The two equilibria that show this nicely are:

$$\ce{NH4+ + H2O<=> NH3 + H3O+}\tag{3}$$ $$\ce{Cd^2+ +4NH3 <=> [Cd(NH3)4]^2+}\tag{4}$$

However, they both contain minor species, so you want to combine them to eliminate the minor species.

If you are experienced at solving equilibria with approximations, you might realize that you can get away with ignoring ammonia and hydroxide at first, and that setting up your equation with initial concentrations of complex and hydronium that are zero makes things easier. Also, if you find this problem in the textbook, you would expect that the solution does not require you to solve a cubic equation. If your first attempt at a path to a solution gets that complicated, you can take a step back and try a different approach.

The second approach fails, the first one works.

In the second approach you initially assume that the ammonium ion hydrolyzes to give equal amounts of $$\ce{H3O^+}$$ and $$\ce{NH3}$$, so you implicitly assumed that the $$\ce{H3O^+}$$ concentration must have matched the $$7.21×10^{-5}$$ molar you found for the $$\ce{NH3}$$. But then your calculation gave a much higher value for $$\ce{H3O^+}$$, indicating a contradiction.

The contradiction came because in fact you do not have equal concentrations of $$\ce{H3O^+}$$ and $$\ce{NH3}$$. The reaction of the cadmium ion with the $$\ce{NH3}$$ inteferes, drawing off the $$\ce{NH3}$$ and thus forcing the hydrolysis of $$\ce{NH4^+}$$ to accumulate more $$\ce{H3O^+}$$. So in reality $$\ce{H3O^+}$$ should have a much greater concentration than $$\ce{NH3}$$.

You can add reactions, but you should take a linear combination that balances out suppressed species like $$\ce{NH3}$$ in this case (or like free electrons in redox reactions). Here the component reactions are, as you describe,

$$\ce{NH4^+ + H2O <=> NH3 + H3O^+}$$

$$\ce{Cd^{2+} + 4 NH3 <=> Cd(NH3)4^{2+}}$$

and balancing out the $$\ce{NH3}$$ which is suppressed in the acidic solution requires taking four times the first reaction and then adding the second. This gives

$$\ce{Cd^{2+} + 4 NH4^+ + 4 H2O <=> Cd(NH3)4^{2+} + 4 H3O^+}$$

which is then the reaction used in the first, correct method.

• When $\ce{NH_4^+}$ initially disassociates, it will produce equal amounts of ammonia and hydronium. That's why their initial concentrations are the same. Their equilibrium concentrations are not in the second reaction :/ Oct 3 at 13:16
• The first method is correct only if concentration of NH3 is constant during the complex formation and there is no conversion between NH3 and NH4+. Oct 5 at 12:19

One thing should catch you eyes immediately.

The first way creates $$\ce{4 H+}$$ for $$\ce{1 [Cd(NH3)4]^2+}$$, your way creates $$\ce{1 H+}$$ for $$\ce{1 [Cd(NH3)4]^2+}$$. And there can be formulated three other versions with $$\ce{0 H+}$$, $$\ce{2 H+}$$ and $$\ce{3 H+}$$ for $$\ce{1 [Cd(NH3)4]^2+}$$.

It is obvious maximally one of five versions can be true. And, in fact, not even one.

All five possible equilibrium constants $$K_\text{eq} = K_\text{f} \cdot K_\text{a}^N$$, $$N=0..4$$ for

$$\ce{Cd^2+(aq) + (4-N) NH3(aq) + N NH4+(aq) <=> [Cd(NH3)4]^2+(aq) + N H+(aq)}$$

are formally correct and equilibrium concentrations will honor them in contexts of concentration = activity simplification.

But the equilibrium equations do not say there is formed $$\ce{N H+}$$ ions for each $$\ce{[Cd(NH3)4]^2+}$$ ion.

Before introduction of the cadmium salt, there is established the equilibrium ammonia concentration due ammonium hydrolysis. This concentration shifts when the cadmium complex is formed.

Let perform this formal substitution for easier expression manipulation:
$$\ce{h = [\ce{H+}]}$$, $$\ce{n1 = [\ce{NH4+}]}$$, $$\ce{n2 = [\ce{NH3}]}$$, $$\ce{c1 = [\ce{Cd^2+}]}$$, $$\ce{c2 = [\ce{[Cd(NH3)4]^2+}]}$$

and we can now formulate visually compact equations for equilibrii,

$$K_\text{a} = \frac{h \cdot n_2}{n_1}$$

$$K_\text{f} = \frac{c_2}{c_1 \cdot n_2^4}$$

for mass balances:

$$n_1 +n_2 + 4 c_2 = c_\text{N,tot}$$

$$c_1 + c_2 = c_\text{Cd,tot}$$

and for charge balance:

$$h + n_1 + 2 c_1 + 2 c_2 = c_\text{chrg}$$

$$\ce{OH-}$$ is neglected and furthermore due unknown temperature we do not know $$K_\text{w}$$.

Substituting $$c_2 = c_\text{Cd,tot} - c_1$$:

$$K_\text{a} = \frac{h \cdot n_2}{n_1}$$ $$K_\text{f} = \frac{c_\text{Cd,tot} - c_1}{c_1 \cdot n_2^4}$$ $$n_1 +n_2 + 4 (c_\text{Cd,tot} - c_1) = c_\text{N,tot}$$ $$h + n_1 + 2 c_1 + 2 (c_\text{Cd,tot} - c_1) = c_\text{chrg}$$

Substituting $$n_1 = c_\text{chrg} - 2c_1 - 2(c_\text{Cd,tot} - c_1) - h$$:

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{chrg} - 2 c_1 - 2 (c_\text{Cd,tot} - c_1) - h}$$ $$K_\text{f} = \frac{c_\text{Cd,tot} - c_1}{c_1 \cdot n_2^4}$$ $$(c_\text{chrg} - 2c_1 - 2(c_\text{Cd,tot} - c_1) - h) +n_2 + 4 (c_\text{Cd,tot} - c_1) = c_\text{N,tot}$$

Simplifying:

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{chrg} - 2 c_\text{Cd,tot}- h}$$ $$K_\text{f} = \frac{c_\text{Cd,tot} - c_1}{c_1 \cdot n_2^4}$$ $$c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - 4c_1 = c_\text{N,tot}$$

Substituting $$c_1 = \frac 14(c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - c_\text{N,tot})$$

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{chrg} - 2 c_\text{Cd,tot}- h}$$ $$K_\text{f} = \frac{c_\text{Cd,tot} - (\frac 14(c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - c_\text{N,tot}))}{(\frac 14(c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - c_\text{N,tot})) \cdot n_2^4}$$

Simplifying:

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{chrg} - 2 c_\text{Cd,tot}- h}$$ $$K_\text{f} = \frac{2c_\text{Cd,tot} - (c_\text{chrg} - h +n_2 - c_\text{N,tot})} {(c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - c_\text{N,tot}) \cdot n_2^4}$$

Simplifying: As $$c_\text{chrg} = 2c_\text{Cd,tot} +c_\text{N,tot}$$:

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{N,tot}- h}$$ $$K_\text{f} = \frac{ h - n_2 } {(c_\text{chrg} + 2c_\text{Cd,tot} - h +n_2 - c_\text{N,tot}) \cdot n_2^4}$$

Approximating: $$c_\text{N,tot} \gg h$$ and $$c_\text{chrg} + 2c_\text{Cd,tot} - c_\text{N,tot} \gg |- h + n_2|$$

$$K_\text{a} = \frac{h \cdot n_2}{c_\text{N,tot}}$$ $$K_\text{f} = \frac{ h - n_2} {(c_\text{chrg} + 2c_\text{Cd,tot} - c_\text{N,tot}) \cdot n_2^4}$$

Substituting: $$n_2 = \frac{K_\text{a} \cdot c_\text{N,tot} }{ h}$$

$$K_\text{f} = \frac{ h - (\frac{K_\text{a} \cdot c_\text{N,tot} }{ h})} {(c_\text{chrg} + 2c_\text{Cd,tot} - c_\text{N,tot}) \cdot {(\frac{K_\text{a} \cdot c_\text{N,tot} }{ h})}^4}$$

$$K_\text{f} = h^3\frac{ h^2 - ({K_\text{a} \cdot c_\text{N,tot} })} {(c_\text{chrg} + 2c_\text{Cd,tot} - c_\text{N,tot}) \cdot {({K_\text{a} \cdot c_\text{N,tot} })}^4}$$

The Excel based iteration $$h=\mathrm{f}(h)$$ provided

$$h=[\ce{H+}]=\pu{9.73E-4} \implies \text{pH} = -\log{h} = 3.01$$

Comparatively, the initial $$[\ce{H+}] \approx \sqrt{K_\mathrm{a}.[\ce{NH4+}]}=\sqrt{\pu{5.2e-8}\cdot 0.1} \approx \pu{7.21E-5 mol L-1} \\ \implies \mathrm{pH} \approx 4.14$$