How to solve for concentration of two equilibrium reactions with finite equilibrium constants?

I have a small problem of equilibrium that I counldn't solve. I want the exact answer. No approximations please. $$\begin{array}{ll} \ce{H2O + H2O <=> H3O+ + OH-} &\quad\left(K_w = 1\cdot 10^{-14}\right) \\ \ce{HNO2 + H2O <=> H3O+ + NO2-} &\quad\left(K_a = 4\cdot10^{-4}\right) \\ \end{array}$$

Objective: Find the concentration every substance, given that the initial value of $[\ce{HNO2}]_0$ is known. Feel free to insert any numerical value for it, if you wish. I have no idea how to solve for the concentrations, when I have two finite ionization constants. How to solve it?

Of course, in this situation, most people would ignore the contribution of the auto-ionization constant of water (that is, ignore the first reaction), leaving only the second one, which is fairly easy to calculate the concentrations. I do not want that.

The reading of this part is optional. Feel free to skip everything down below if you wish. This is an example that I understood how to solve: $$\begin{array}{ll} \ce{H2O + H2O <=> H3O+ + OH-} &\quad\left(K_w = 1\cdot 10^{-14}\right) \\ \ce{HCl + H2O <=> H3O+ + Cl-} &\quad\left(\mbox{Full Dissociation}\right) \\ \end{array}$$

Hereby, lets say we had an initial concentration of $[\ce{HCl}]_0$. It will then fully dissociate, thus we shall have: $[\ce{HCl}]_0 = [\ce{H3O+}]_0$. Now we correct considering the water autoionization:

$$\begin{array}{ll} [\ce{H3O+}] = [\ce{HCl}]_0 + x \\ [\ce{OH-}] = x \\ \end{array}$$

We solve for $x$ such that $[\ce{H3O+}][\ce{OH-}] = K_w$. This will give me a quadratic equation, which using bhaskara becomes easy to solve.

Again, most people here would ignore the first reaction. And, in certain circumstances, they could, for instance, find a potentially wrong value of $\text{pH}$. Classical example: Just let $[\ce{HCl}]_0 = 10^{-8}$, and then ignoring water autoionization, it will fully dissociate thus $[\ce{H3O+}]_0 = 10^{-8}$, giving $\mathrm{pH = 8}$. So, we just got a basic $\text{pH}$ after just inserting hydrochloric acid in water!

The main reactions which take place are $$\begin{array}{ll} \ce{ H2O <=> H+ + OH-} &\quad\left(K_\mathrm{w}= 1\times 10^{-14}\right) \\ \ce{HNO2 <=> H+ + NO2-} &\quad\left(K_\mathrm{a}= 4\times10^{-4}\right) \\ \end{array}$$ $$\ce{HNO2}$$ acid is a weak acid, which does not dissociate completely in water. This means it does not give all its hydrogen ions into the water, the resulting solution contains four species $${\ce{H+}, \ce{OH−},\ce{NO2−}}$$, and undissociated acid $$\ce{HNO2}$$. In order to specify the concentrations of the four species present in an aqueous solution of $$\ce{HNO2}$$, we need four independent equations between them. These are :

1- Equilibria. We have two equilibrium equations:

The dissociation equilibrium of water $$\ce{ K_\mathrm{w}=[H+][OH−]}\tag{1}$$ The dissociation equilibrium of acid $$\mathrm{ K_\mathrm{a}}=\frac{[H^+]_e[NO_2^−]_e}{ [HNO_2]_e}\tag{2}$$
2- Mass balance. The mass balance equation that relates the concentrations of the various dissociation products of the substance to its initial concentration, which we designate here as $$\ce[HNO_2]_0$$. For the solution of $$\ce{HNO_2}$$, this equation would be
$$\ce{[HNO2]_0 = [HNO2]_e + [NO2−]_e}\tag{3}$$ 3-Charge balance. In any ionic solution, the sum of the positive and negative electric charges must be zero; in other words, all solutions are electrically neutral. This is known as the electroneutrality principle. $$\ce{[H+]_e = [NO2−]_e + OH−}_e\tag{4}$$
We can use $${\text{Eq}\mathrm{3}}$$ to get an expression for $$\ce{[HNO2]_e}$$, and this can be solved for$$\ce{ [NO2−]_e}$$; these are substituted into $$\text{ Eq}\mathrm{2}$$ to yield $$K_\mathrm{a}=\frac{\ce{ [H+]_e} {([H^+]_e - [OH^-]_e)} }{[HNO_2]_0 - [H^+]_e + [OH^-]_e} \tag{5}$$ This equation is cubic in $$\ce{[H+]_e}$$ when $$\ce{[OH−]}$$ is expressed as $$\frac{K_\mathrm{w}}{\ce{[H+]_e}}$$; it becomes as

$$K_\mathrm{a}=\frac{\ce{[H+]_e} {([H^+]_e – K_\mathrm{w}/{[H^+]_e})} }{[HNO_2]_0 - [H^+]_e + K_\mathrm {w}/{[H^+]_e}} \tag{6a}$$ Or $$\ [\ce{H+}]_e^3 + K_\mathrm{a} [\ce{H+}]_e^2 -(K_\mathrm{w} + [\ce{HNO2}]_0K_\mathrm{a})[\ce{H+}]_e - K_\mathrm{w} K_\mathrm{a} \tag{6b}$$ For most practical applications, we can make approximations that eliminate the need to solve a cubic equation.

a- Unless the acid is extremely weak or the solution is very dilute, the concentration of $$\ce{OH−}$$ can be neglected in comparison to that of $$\ce {[H+]_e}$$. If we assume that $$\ce{[OH−]_e<<[H+]_e}$$, then $$\text{Eq}\mathrm{5}$$ can be simplified to $$K_\mathrm{a }=\frac{[H^+]_e^2}{[HNO_2]_0 –[H^+]_e}\tag{7}$$ which is a quadratic equation: $$\ce{[H^+]_e^2 + K_\mathrm{a}[H+]_e – K_\mathrm{a}[HNO_2]_0 = 0}\tag{8}$$
b-If the acid is fairly concentrated (usually more than $$\mathrm{10^{−3}}\text{M}$$), a further simplification can frequently be achieved by making the assumption that$$\ce{ [H^+]_e << [HNO_2]_0}$$. This is justified when most of the acid remains in its protonated form$$\ce{ [HNO_2]_e}$$, so that relatively little $$\ce{H+}$$ is produced. In this event,$$\text{Eq}\mathrm{7}$$ reduces to $$K_\mathrm{a}=\frac{[H^+]_e^2}{[HNO_2]_0}\tag{9}$$
Or $$\ce{[H^+]} \approx \sqrt{K_\mathrm{a}\ce{[HNO_2]_0}}\tag{10}$$
- Comparing of the$$\ce{ [H+]_e }$$values resulted from solution the three derived equations when the initial acid concentration equal $$\mathrm{0.1}\text{M}$$

1- The completely accurate answer solution using cubic equation $$\mathrm{(6b)}$$by wolframalpha

$$\ce{[H+]_e} = 0.00612772\text{M}$$

2- The approximate answer solution using quadratic equation $$\mathrm{(8)}$$

$$\ce{[H+]_e} = 0.00612771680\text{M}$$

3- The further approximate answer solution using the reduced equation $$\mathrm{(10)}$$ $$\ce{[H+]_e} = 0.00632455532\text{M}$$

• I'd run a solid black line after the equation 6b and say something to the effect "This is exact. Now to the approximations." – Ivan Neretin Aug 28 '18 at 12:19