Complex formation in water and Henry's law

I've been trying to solve the following problem for a while now.

Consider a mixture of two different gases ($$A$$ and $$B$$) for which Henry's law holds. When gas molecules $$A$$ and $$B$$ do not interact with each other in either the gas phase or in water, the amount of each that will be dissolved in water is determined only by its partial pressure and does not depend on the partial pressure of the other gas. However, let us now consider the case in which $$A$$ and $$B$$ form a complex $$AB$$ when they are dissolved in water:

$$\ce{A(l) + B(l) <=> AB(l)}$$

Let $$x_i$$ ($$i$$ = $$A$$, $$B$$, $$AB$$) be the mole fraction of the dissolved species, and let $$K_{AB}$$ be the equilibrium constant for the above equation:

$$K_{AB} = \frac{x_{AB}}{x_Ax_B}$$

Suppose that water ($$V_l$$ = $$\pu{1.00 L}$$) and a gas mixture are filled into a container ($$V = \pu{2.00 L}$$) at $$\pu{25^\circ C}$$. The Henry coefficients of $$A$$ and $$B$$ are $$1.0×10^4$$ , and $$\pu{2.0E4 bar}$$, respectively, and $$K_{AB}=500$$. The initial partial pressures of each gas, $$P_A^0$$ and $$P_B^0$$, are both $$\pu{2 bar}$$.

1) Calculate the pressure of each gas and the mole fractions of the dissolved gas molecules after the equilibrium is established.

2) Calculate the percentage of the mole fraction of dissolved gas $$B$$ relative to that found in question 1) when the initial partial pressure of gas $$A$$ is increased to $$\pu{10 bar}$$.

I'm having trouble coming up with the right equations to cope with the multiple unknown variables. What I have come up with so far is the following.

$$n(A)_{g,i} = n(B)_{g,i} = \frac{P^0V}{RT} = \pu{0.08072 mol}$$

$$n(\ce{H_2O}) = \frac{1000}{18.016} = \pu{55.51 mol}$$

$$x_A = \frac{P_A}{k_{H,A}}$$

$$x_B = \frac{P_B}{k_{H,B}}$$

$$x_{AB} = K_{AB}\cdot \frac{P_A}{k_{H,A}}\cdot\frac{P_B}{k_{H,B}}$$

$$P_{f,y} = \frac{n(y)_{g,f}RT}{V}$$

$$P_{f,y} = k_H x_y \approx k_H\frac{n(y)}{n(\ce{H_2O})}$$

$$\frac{n(y)_{g,f}RT}{V} = k_H\frac{n(y)}{n(\ce{H_2O})}$$ (1)

I'm not sure how to involve the effects of the complexation equilibrium on the moles of dissolved gas $$A$$ and $$B$$, respectively. Normally I would calculate the number of moles dissolved using the following formula derived from equation (1) ($$y$$ is any chosen gas):

$$n(y)_l = \frac{n(H_2O)n(y)_{g,i} RT}{n(H_2O) RT + k_{H,y} V}$$

But this doesn't take into account the equilibrium formed when $$A$$ and $$B$$ are dissolved in water and form the complex $$AB$$.

• There are a number of short guides on formatting with mathjax and mhchem available in the meta section of the site. Please take a look: chemistry.meta.stackexchange.com/questions/86/… mhchem command \ce is for formatting chemical formulae. Please do not enclose math notation with this command. May 5 at 18:45