Assuming the gas to be ideal the work done on the gas in taking it from A to B is