Calculate Work Done for Reversible and Irreversible Adiabatic process
For an irreversible process, the pressure of the gas within the system is typically non-uniform spatially, and so there is no unique value that can be used in conjunction with the ideal gas law to calculate the work.  But, at the interface with the surroundings, the force per unit area exerted by the gas on the interface always exactly matches the pressure of the surroundings, which is usually referred to as $P_{ext}$.  So, if $P_{ext}$ can be controlled externally as a function of the volume, one can calculate the amount of work done by the gas on the surroundings.  In many homework problems encountered in thermodynamics, the value of $P_{ext}$ is often specified as being constant during an irreversible process.  

In addition to the effects of pressure and temperature nonuniformities in a gas experiencing a rapid irreversible expansion or compression, there is also another physical mechanism acting.  This is related to the viscous behavior of a gas that is deforming.  In the case of a rapid irreversible deformation, the gas pressure depends not only on the gas volume, but also on the rate of change of volume.  The behavior is analogous to that of an ideal spring and damper in parallel (as in the front suspension of a car).  The force exerted on a spring/damper combination during a rapid stretching or compression depends both on (a) how much the combination is stretched, but also on (b) how rapidly it is stretched (because of the effect of the damper).  A very crude approximation to the behavior of an ideal gas that is experiencing a rapid (irreversible) rate of deformation is provided by the equation:  $$P=\frac{nRT}{V}-\frac{k}{V}\frac{dV}{dt}=P_{ext}$$ where k is a positive quantity related to the viscosity of the gas.  So the gas pressure on the piston face depends both on the amount of volume change and on the rate of volume change.  The equation indicates that, during rapid expansion (i.e., dV/dt > 0), the pressure exerted by the gas on the surroundings is less than that given by the ideal gas law, while, during rapid compression (i.e., dV/dt &lt; 0), the pressure exerted by the gas on the surroundings is greater than that given by the ideal gas law.