Reversible and irreversible processes of thermodynamics
For both reversible and irreversible processes, the pressure of the gas at the interface with the surroundings exactly matches the external pressure imposed by the surroundings $P_{ext}$, and the work done on the surroundings is always equal to $\int{P_{ext}}dV$.  (The equation you wrote for an irreversible process applies only if $P_{ext}$ is held constant).  However, for an irreversible process, the pressure of the gas at the interface is not given by the ideal gas law, because (a) there are viscous (dissipative) stresses that contribute to the pressure at the interface and (b) the pressure and temperature of the gas is not uniform within the cylinder.  So we need to specify how $P_{ext}$ varies during the process (say, as a function of the volume V) manually in order to analyze an irreversible process.  

For more details on this, see the following link:  Calculate Work Done for Reversible and Irreversible Adiabatic process