Let us consider 'n' moles of an ideal gas enclosed in a cylinder fitted with a frictionless, weightless and movable piston. Let P be the pressure of the gas and P-dP be the external pressure under which volume of the gas increased by dV, then work done in this expansion is
dw = −(P − dP)dV = − PdV (as dP.dV is very small).
For a infinite volume change from V1 to V2, the total work done during expansion-