pH calculation for buffer solution