Calculating the amounts of acid and base for a buffer