Work done by gas on atmosphere and work done by atmosphere on gas Consider a cylindrical container contaning a gas with pressure P1 and volume V1 with a massless piston on top of the cylinder. There is a block of mass m on top of the piston. Suddenly, the mass is removed and so the gas expands irreversibly to a final pressure of P0 which is the external atmospheric pressure. Now I know that work done on a system depends on external forces, so the work done on gas will be = P0 *(change in volume)
Now, I want to know the work done on the atmosphere. So, in this case, my system will be the atmosphere and surroundings should be cylinder contaning the gas. So, work done on atmosphere by the gas will be = - P1 * (change in volume of container)......(or it should be an integral where pressure of gas changes from lower limit of P1 to an upper limit of P0).
So my question is, why are the two work calculated different? Is what I've done correct? One of my friend said that the way I'm calculating the work done by the gas on atmosphere is incorrect, if this is true, then what is the correct way?
 A: First let me say that you are correct, and your friend is incorrect.
The work done by the gas on its surroundings is equal to the force per unit area exerted by the gas on the inside piston face integrated over the volume change.  But, in a very rapid (irreversible) expansion, the force per unit area acting on the piston face is different from that for a very slow deformation, for two reasons.  First of all, the pressure of the gas within the cylinder is not uniform (as a result of gas inertia), so that the volume average of the local gas pressure within the cylinder differs from that at the piston face. Secondly, there are viscous stresses present within the gas, such that the force at the piston face depends not only on the instantaneous volume of the gas, but also on the rate at which the gas volume is changing.  So, in a rapid deformation, the gas behavior is not described by the ideal gas law. So the ideal gas law can't be used, except for the initial and final thermodynamic equilibrium states of the gas.
In the situation you are describing, your only connection to the force per unit area exerted by the gas on the piston comes from the external specification.  From a force balance on the massless piston, the force per unit area of the gas on the piston face is equal to the external atmospheric pressure.  This is one of the few situations where you can easily determine the work done by the gas in an irreversible expansion or compression.  
And of course, for a massless piston, by Newton's third law, the work done by the gas on the piston is minus the work done by the piston (and atmosphere) on the gas.
