rude man said:
My question too, Chet! Why is pressure essentially constant and equal to the final equilibrium pressure? Otherwise I think I follow.
In an irreversible compression like this, the gas pressure within the cylinder is non-uniform spatially, and, in addition, viscous stresses within the gas contribute to the force per unit area exerted by the gas on the piston face. It is this force by the gas that does the work on its surroundings. So, the ideal gas law cannot be applied to get the gas force on the piston face.
In addition, in this problem, the gas force on the piston face clearly varies with time. So, how does one proceed? Well, we if we apply Newton's 2nd law to the piston, we obtain:
$$F(t)-mg-p_aA=m\frac{dv}{dt}$$where F(t) is the force exerted by the gas on the piston at time t, m is the mass of the piston, A is the piston cross sectional area, and ##p_a## is the air pressure. If we multiply this equation by the piston v=dx/dt, we obtain the mechanical energy balance equation: $$F\frac{dx}{dt}-mg\frac{dx}{dt}-p_aA\frac{dx}{dt}=mv\frac{dv}{dt}=m\frac{d(v^2/2)}{dt}$$
If we integrate this equation with respect to t, we obtain:
$$\int_{0}^{x(t)}F(x)dx=\left(\frac{mg}{A}+p_a\right)(V(t)-V(0))+m\frac{v^2(t)}{2}$$
The left hand side of this equation is the work done by the gas on the piston between time zero and time t, and the last term on the right hand side of this equation is the kinetic energy of the piston at time t. At relatively short times, the piston will overshoot the equilibrium position and oscillate up an down, so its kinetic energy will be varying with time. But, as time progresses, the oscillation of the piston will be damped out by viscous dissipation caused by the viscous stresses within the gas. (There is no need for actual friction between the piston and the cylinder to bring about this damping, and, in this analysis, we assume that the contact between the piston and the cylinder is frictionless). So, at very long times, we will have:
$$W=\int_{0}^{\infty}F(x)dx=\left(\frac{mg}{A}+p_a\right)(V(\infty)-V(0))$$
But this equation is exactly the same relationship we would have obtained if we had assumed that the gas force on the piston face were constant at its final equilibrium value throughout the entire expansion/compression.