Irreversible and reversible compression work Why is work done on the gas when it is compressed from (p2,V2) (pressure,volume) to (p1,V1) against constant pressure external pressure p1 maximum when it is done irreversibly?
In reversible process, there is no loss of energy as the system is always in equilibrium with surrounding, so I thought that it would be max for reversible process.
Also work done on the gas is positive for compression, so there is no sly trick in the question as to which is less negative.
 A: I'm going to assume that your comment is part of your question.  Actually, you have it backwards.  The volumetric work done by the surroundings on the gas is always  $$W=-\int_{V_1}^{V_2}{P_{ext}dV}$$ irrespective of whether the process is reversible or irreversible, where $P_{ext}$ is the external force per unit area exerted by the surroundings on the gas at the interface between the system and surroundings at which the displacement is occurring.  So, for compression W is positive if $V_1>V_2$ and negative if $V_1<V_2$.  
For a reversible volume change, $P_{ext}$ can be taken as being equal to the pressure of the gas calculated from the equation of state, but for an irreversible volume change, since the equation of state does not apply to non-equilibrium states of a gas, the equation of state can't be used.  In an irreversible process, there are (un-quantified)viscous stresses also present within the gas that contribute to the force per unit area exerted by the gas at its interface with its surroundings.  Therefore, for an irreversible process, our only option for being able to calculate the work is to specify the external pressure $P_{ext}$ manually by imposing a known force per unit area (as a function of time) at the interface or somehow automatically controlling the external pressure.
