In thermodynamics, work done during a process depends on the path taken.
A reversible process is an ideal process that happens infinitely slowly so that the system is in equilibrium at every stage. In contrast, an irreversible process occurs rapidly and does not maintain equilibrium.
Step 1:
In a reversible expansion, the external pressure is always infinitesimally less than the internal pressure. The gas does more work because it pushes the piston through a larger distance at each step.
\[
W_{\text{rev}} = - \int_{V_i}^{V_f} P_{\text{ext}} dV
\]
Step 2:
In an irreversible expansion, the external pressure is constant and less than the internal pressure. Since the external pressure is constant and lower than in the reversible case, the work done is less.
\[
W_{\text{irr}} = - P_{\text{ext}} (V_f - V_i)
\]
Step 3:
Comparing both, for the same initial and final states:
\[
|W_{\text{irr}}| < |W_{\text{rev}}|
\]
Step 4:
Therefore, for expansion, \( W_{\text{irr}} < W_{\text{rev}} \). For compression, the inequality reverses in magnitude but the same principle applies — reversible work is maximum in magnitude.
Hence, in general:
\[
W_{\text{irr}} < W_{\text{rev}}
\]