# When does a piston stop in an irreversible process?

Suppose we have an ideal gas filled inside a container fitted with a piston. The external pressure is equal to internal pressure.

If we suddenly decrease the external pressure, we say that the gas will expand until the internal pressure and external pressure become equal.

Considering an irreversible process, shouldn't the gas expand beyond that point because by that time the piston will have gained some velocity?

If I do a force balance (Newton's 2nd law) on the piston, I get $$F_\mathrm{g} - p_0 A = m \frac{\mathrm{d}v}{\mathrm{d}t},$$ where $$F_\mathrm{g}$$ is the force the gas exerts on the piston, $$p_0$$ is the outside pressure, $$A$$ is the piston cross sectional area, $$m$$ is the mass of the piston, and $$v$$ is the piston velocity. If I multiply this equation by the velocity of the piston $$v = \mathrm{d}x/\mathrm{d}t$$, and integrate with respect to time, I obtain:
$$W_\mathrm{g}(t) = \int\limits_0^{x(t)} F_\mathrm{g}\,\mathrm{d}x = p_0(V(t) - V(0)) + m\frac{v(t)^2}{2},$$ where $$W_\mathrm{g}(t)$$ is the work done by the gas on the piston (its surroundings) up to time $$t$$, $$V(t)$$ is the gas volume at time $$t$$, and $$m\frac{v(t)^2}{2}$$ is the kinetic energy of the piston at time $$t$$. At infinite time, the piston is no longer moving, so its kinetic energy is zero at final equilibrium. Therefore, at final equilibrium, the work done by the gas is just $$W_\mathrm{g}(\infty) = p_0\Delta V, \text{ where } \Delta V = V(\infty)-V_0.$$