When strong acid or base is added to a buffer, it reacts completely with one buffer partner first. So the calculation has two stages: stoichiometry, then equilibrium.
Key idea
Stage 1: work in moles. The added $\mathrm{OH^-}$ converts that many moles of HA to $\mathrm{A^-}$ (or added $\mathrm{H_3O^+}$ converts $\mathrm{A^-}$ to HA). Stage 2: put the new mole ratio into $\text{pH} = \text{p}K_a + \log\dfrac{n_{\mathrm{A^-}}}{n_\mathrm{HA}}$.
Why it works
A strong base reacting with a weak acid has an enormous equilibrium constant ($K = K_a/K_w$, about $10^{9}$ for acetic acid), so it goes to completion before anything else matters. Only after that does the weak-acid equilibrium set the pH. Moles are easier than molarities here because adding a solution changes the volume, but both buffer partners share the same final volume, so the volume cancels from the ratio.
Worked examples
Worked example: Adding base
A $500\ \text{mL}$ buffer is $0.20\ \text{M}$ in $\mathrm{CH_3COOH}$ and $0.20\ \text{M}$ in $\mathrm{CH_3COO^-}$ ($\text{p}K_a = 4.74$). Add $0.020\ \text{mol}$ NaOH. Find the pH.
- Moles: $0.100\ \text{mol}$ of each partner.
- Stage 1: $\mathrm{CH_3COOH + OH^- \to CH_3COO^- + H_2O}$. HA: $0.100 - 0.020 = 0.080\ \text{mol}$; $\mathrm{A^-}$: $0.100 + 0.020 = 0.120\ \text{mol}$.
- Stage 2: $$\text{pH} = 4.74 + \log\dfrac{0.120}{0.080} = 4.74 + 0.18 = 4.92$$
Answer: $\text{pH} = 4.92$ (up from 4.74).
Worked example: Adding acid to an ammonia buffer
To $100\ \text{mL}$ of a buffer with $0.25\ \text{M}$ $\mathrm{NH_3}$ and $0.20\ \text{M}$ $\mathrm{NH_4^+}$ ($\text{p}K_a = 9.25$), add $10.0\ \text{mL}$ of $1.0\ \text{M}$ HCl.
- Moles: $\mathrm{NH_3}$ $0.025$, $\mathrm{NH_4^+}$ $0.020$, HCl $0.010\ \text{mol}$.
- Stage 1: $\mathrm{NH_3 + H_3O^+ \to NH_4^+ + H_2O}$. $\mathrm{NH_3}$: $0.015\ \text{mol}$; $\mathrm{NH_4^+}$: $0.030\ \text{mol}$.
- Stage 2: $$\text{pH} = 9.25 + \log\dfrac{0.015}{0.030} = 9.25 - 0.30 = 8.95$$ The total volume (110 mL) never entered.
Answer: $\text{pH} = 8.95$.
Worked example: Too much acid
Add $0.15\ \text{mol}$ HCl to the acetate buffer of the first example ($0.100\ \text{mol}$ of each partner, $500\ \text{mL}$). What happens?
- All $0.100\ \text{mol}$ of acetate is used, and $0.050\ \text{mol}$ HCl is left over. The buffer is exhausted.
- The excess strong acid sets the pH: $[\mathrm{H_3O^+}] = 0.050/0.500 = 0.10\ \text{M}$, pH 1.00 (the acetic acid adds almost nothing).
Answer: $\text{pH} = 1.00$: the buffer's capacity was exceeded.
The same two-stage method gives every point on a weak-acid titration curve before the equivalence point.
Common mistake
Putting the added moles into an equilibrium (ICE) calculation before doing the neutralization. Strong acid and base react completely first. Check: after stage 1, there should be no strong acid or base left (unless the buffer has been used up).