Concept
A weak acid (\(\text{HA}\)) partially ionizes in water:
\[
\text{HA} + \text{H}_2\text{O} \rightleftharpoons \text{H}_3\text{O}^{+} + \text{A}^{-},
\qquad
K_a=\dfrac{\big[\text{H}_3\text{O}^{+}\big]\big[\text{A}^{-}\big]}{\big[\text{HA}\big]}
\]
A weak base (\(\text{B}\)) accepts a proton:
\[
\text{B} + \text{H}_2\text{O} \rightleftharpoons \text{BH}^{+} + \text{OH}^{-},
\qquad
K_b=\dfrac{\big[\text{BH}^{+}\big]\big[\text{OH}^{-}\big]}{\big[\text{B}\big]}
\]
The calculator treats monoprotic acids and bases, solves the exact quadratic for the
equilibrium extent, and reports \(\mathrm{pH}\) and \(\mathrm{pOH}\). No \(\ce{…}\) is used; all formulas are standard \(\LaTeX\).
Forward problem — from \(C_0\) and \(K\) (or \(pK\)) to pH/pOH
ICE set-up (weak acid). With initial concentration \(C_0\) and extent \(x=\big[\text{H}_3\text{O}^{+}\big]\):
\[
\big[\text{HA}\big] = C_0 - x, \qquad
\big[\text{A}^{-}\big] = x, \qquad
\big[\text{H}_3\text{O}^{+}\big] = x
\]
\[
K_a=\frac{x\cdot x}{C_0-x}
\;\Longrightarrow\;
x^2 + K_a\,x - K_a\,C_0 = 0
\;\Longrightarrow\;
x=\frac{-K_a+\sqrt{K_a^{2}+4\,K_a\,C_0}}{2}
\]
Then \(\mathrm{pH}=-\log_{10}\!\big(\big[\text{H}_3\text{O}^{+}\big]\big)\) and
\(\mathrm{pOH} = pK_\mathrm{w}-\mathrm{pH}\).
ICE set-up (weak base). Let \(x=\big[\text{OH}^{-}\big]\):
\[
\big[\text{B}\big] = C_0 - x, \qquad
\big[\text{BH}^{+}\big] = x, \qquad
\big[\text{OH}^{-}\big] = x
\]
\[
K_b=\frac{x\cdot x}{C_0-x}
\;\Longrightarrow\;
x=\frac{-K_b+\sqrt{K_b^{2}+4\,K_b\,C_0}}{2}
\]
Then \(\mathrm{pOH}=-\log_{10}\!\big(\big[\text{OH}^{-}\big]\big)\) and
\(\mathrm{pH}=pK_\mathrm{w}-\mathrm{pOH}\).
Shortcut and validity check
When the dissociation is small (\(x \ll C_0\)), the square-root approximation applies:
\[
x \approx \sqrt{K\,C_0}\quad\text{and}\quad
\alpha = \frac{x}{C_0} \ll 1
\]
A common rule of thumb is the “5% rule”: if \(\alpha \le 0.05\), the shortcut is usually acceptable.
The calculator reports \(\alpha\) and the relative error between the exact and shortcut \(x\).
Inverse problem — from \(C_0\) and measured pH/pOH to \(K\) (and \(pK\))
Weak acid (use pH). Set \(x=\big[\text{H}_3\text{O}^{+}\big]=10^{-\mathrm{pH}}\). Then
\[
K_a=\frac{x^{2}}{C_0-x}, \qquad pK_a=-\log_{10}\!\left(K_a\right)
\]
Weak base (use pOH). Set \(x=\big[\text{OH}^{-}\big]=10^{-\mathrm{pOH}}\). Then
\[
K_b=\frac{x^{2}}{C_0-x}, \qquad pK_b=-\log_{10}\!\left(K_b\right)
\]
Links between \(K_a\), \(K_b\), and \(K_\mathrm{w}\)
Conjugate pairs satisfy \(K_a K_b = K_\mathrm{w}\) and \(pK_a+pK_b = pK_\mathrm{w}\).
At \(25^\circ\text{C}\), \(K_\mathrm{w}\approx 1.0\times 10^{-14}\) so \(pK_\mathrm{w}\approx 14.00\).
Worked micro-examples (for orientation)
-
Acetic acid, \(C_0=0.100\,\mathrm{mol\cdot L^{-1}}\), \(K_a=1.8\times 10^{-5}\):
\(x=\dfrac{-K_a+\sqrt{K_a^{2}+4K_aC_0}}{2}\approx 1.3\times 10^{-3}\,\mathrm{M}\),
\(\mathrm{pH}\approx 2.89\).
-
Methylamine, \(C_0=2.50\times 10^{-3}\,\mathrm{mol\cdot L^{-1}}\), \(K_b=4.2\times 10^{-4}\):
\(x\approx 8.4\times 10^{-4}\,\mathrm{M}\), \(\mathrm{pOH}\approx 3.08\), \(\mathrm{pH}\approx 10.92\).
Scope & pitfalls
-
The quadratics above neglect the autoionization of water in the mass balance.
This is excellent for typical lab concentrations; however, at very low \(C_0\)
(on the order of \(10^{-6}\,\mathrm{M}\) or below), water can contribute noticeably and a
more complete charge–balance treatment may be required.
-
The model is for monoprotic acids/bases. For polyprotic acids or polybasic amines,
treat only the dominant step with its own \(K\) or use a multi-equilibrium approach.
-
Reported \(K\) values are thermodynamic; using molarities assumes activities \(\approx\) concentrations (ideal solution).
Symbol key
\(C_0\): initial formal concentration; \(\,x\): equilibrium amount
(\(\big[\text{H}_3\text{O}^{+}\big]\) for acids or \(\big[\text{OH}^{-}\big]\) for bases);
\(K\in\{K_a,K_b\}\); \(pK=-\log_{10}K\); \(K_\mathrm{w}\): ionic product of water; \(pK_\mathrm{w}=-\log_{10}K_\mathrm{w}\);
\(\alpha=x/C_0\): degree of ionization.