Calculating the pH of buffer solutions