Assume you have a buffer solution that was prepared by adding 25.0 ml of a 0.1 M sodium hydroxide (NaOH) solution to 75.0 ml of an 0.1 M solution of acetic acid (CH3COOH), where "M" denotes molar concentration. Note that acetic acid reacts with NaOH to form the conjugate base, CH3C00H-, as follows: CH3COOH + NaOH = CH3C00- + Na + H20. In order to calculate the pH, it is necessary to calculate the amounts of acid and conjugate base in the buffer solution following the reaction.
Calculate the initial moles of base and acid in the buffer solution. For example, moles of NaOH = 25.0 ml x 0.1 mole/liter x 1 liter/1000 ml = 0.0025 moles; moles of CH3COOH = 75.0 ml x 0.10 mole/liter x 1 liter/1000 ml = 0.0075 moles.
Note that, upon mixing the solutions, the CH3COOH consumes the OH- (hydroxyl) ions associated with the NaOH, so that what remains is 0.0050 moles of CH3COOH (acid), 0.0025 moles of CH3COO- (base) and 0 moles of OH-.
Substitute the pKa of the acid (4.74 for acetic acid) and the acid and base concentrations into the Henderson-Hasselbalch equation to calculate the pH of the buffer solution. For example, pH = 4.74 + log (0.0025/0.005) = 4.74 + log 0.5 = 4.44.