There are two types of work a system can do. There is nonexpansion work and expansion work. Expansion work is the work that concerns a change in the volume of a system. The equation relating work to volume is w=-Pex
V, but this only applies when external pressure is constant. When external pressure is not constant, we use w=-nRT*ln(Vfinal
). This is how you figure out a change in volume's effect on work.