..............and we remember that pH=−log10[H3O+] by definition.... and we must also write the following equation to show the 1:1 equivalence..........
NaOH(aq)+HCl(aq)→NaCl(aq)+H2O(l)
(a) Unequal volumes of same concentration acid and base are added.....there is a 10⋅mL excess of 0.310⋅mol⋅L−1 sodium hydroxide solution in a NEW volume of 72.0⋅mL solution........
Moles of NaOH(aq)Volume=0.01⋅L×0.310⋅mol⋅L−172.0⋅mL×10−3⋅L⋅mL−1=0.0431⋅mol⋅L−1
........with respect to NaOH.
pOH=−log10[HO−]=−log10(0.0431)=−(−1.37)
pH=14−pOH=14−1.37=12.6
(b) This time an EXCESS of acid is added......
Moles of acid=31.0×10−3⋅L×0.310⋅mol⋅L−1=9.61×10−3⋅mol
Moles of base=21.0×10−3⋅L×0.410⋅mol⋅L−1=8.61×10−3⋅mol
And thus [H3O+]=1.00×10−3⋅mol52×10−3⋅L=0.0192⋅mol⋅L−1
pH=−log10[H3O+]=−log10(0.0192)=−(−1.71)=1.71
Are the respective pH values consistent with (i) an excess of base, and (ii) an excess of base? Enquiring minds want to know!
For the background to these calculations, see here for pH and pOH and here for buffers