The formula for pressure-volume work I have been given in the textbook I am using to learn general chemistry (Chemistry.A.Molecular.Approach.Global.Edition.4th.Edition, Nivaldo J.Tro) is as follows:
w = -PΔV where P is the external pressure. Why is the external pressure used if the force is from the expanding gas, not from the external atmosphere?
N.B: The system is a gas trapped in cylinder between a dead end and a piston. We assume that the piston is massless. We assume that the pressure is constant.