Calculate for example the $pH$ of $100\;mL$ $NH_3\; 0.1\; M$ $(pK_b\;=\;4.80$, $K_b\;=\;1.584\cdot 10^{-5})$ mixed with $100\;mL$ $NaOH\; 0.01\; M$
(1) Electroneutrality: $[OH^-]$ $=$ $[H_3O^+]$ $+$ $[Na^+]$ $+$ $[NH_4^+]$ (2) Conservation of matter: $[Na^+]=0.0050$ (!dilution) (3) Conservation of matter: $[NH_3]+[NH_4^+]$ $=$ $0.050$ (!dilution) (4) Ionic product of water: $[H_3O^+][OH^-]$ $=$ $10^{-14}$ (5) Acidity constant: $\frac{[NH_4^+][OH^-]}{[NH_3]}$ $=$ $10^{-4.80}$
Elimination of all variables as a function of $[H_3O^+]$ : $10^{4.80}[OH^-]^3$ $+$ $(1$ $-$ $0.005\cdot10^{4.80}$ $-$ $0.05\cdot10^{9.2})[OH^-]^2$ $+$ $(0.005$ $-$ $0.050-10^{-9.2})[OH^-]$ $-$ $10^{-14}$ $=$ $0$ Solving this → 3rd degree equation, we find: $x=0.0051533$ $pH=11.71$