Calculating the pH of a weak acid