Effect of medium on dissociation of carboxylic acids