Calculation of pH of buffer solution