Why are the two versions of the 1st law of thermodynamics equivalent? The first law of thermodynamics says the change in internal energy of a closed system is equal to the amount of heat supplied to the system, minus the amount of work done by the system on its surroundings. Mathematically:
$$\Delta U=Q-W$$
For a system undergoing a quasistatic process, we thus have
$$dU=\delta Q-PdV$$
where $P$ is the pressure of the system and $dV$ is the chance in volume of the system.
The first law is also sometimes written
$$\Delta U=Q+W$$
where this time $W$ is the work done by the surroundings on the system. We thus have
$$dU=\delta Q-P_\text{ext} dV$$
where $P_\text{ext}$ is the pressure exerted on the system by the surroundings. 
If the two statements of the fist law are equivalent, then we should have that P_ext=P, but this is only true if the process is reversible.
So what is the error in my reasoning?
After all, by newton's third law, it should hold that the work done by the system on it's surroundings is equal to negative of the work done by the surroundings on the system (since a force applied by the surroundings on system accompanies a force of the same magntidude and in the opposite direction applied by system on surroundings).
 A: Irrespective of whether the process is reversible (quasi-static) or irreversible, the equation for the first law of thermodynamics is always $$\Delta U=Q-\int{P_{ext}dV}$$where $P_{ext}$ is the force per unit are exerted by the gas on its surroundings at the interface between the gas and its surroundings (and by the surroundings on the gas).  
In an irreversible process, the behavior of a gas is very different from that at thermodynamic equilibrium, and depends not only on the volume, temperature, and number of moles of the gas but also on the rate at which the volume is changing.  In addition, the pressure and temperature of the gas are typically not even uniform spatially within the system.  So one cannot use an equation of state (e.g., the ideal gas law) to calculate $P_{ext}$.  Instead, $P_{ext}$ must be specified from the external forces that are applied to the gas by its surroundings.  These external forces will match those of the gas only at its interface.
On the other hand, for a reversible process, the system passes through a continuous sequence of thermodynamic equilibrium states, and, as a result, the pressure within the system is uniform, and given by the equation of state such as the ideal gas law.  So, for a reversible process involving an ideal gas, we can write $$P_{ext,rev}=P_{IG}=\frac{nRT}{V}$$
A: You argument on the last paragraph is correct. If you define the law as
$$\delta U = Q + W,$$
then, it should be $$W = P_{\rm ext}dV,$$ which is the energy that the surroundings give to the system. So, your last equation should get a plus sign on the right-hand-side. This implies $\{dV\}_2 = - \{dV\}_1$, because in the second case, the surrounding is expanding when the gas is shrinking. The value of pressure is the same, $P=P_{\rm ext}$, as you argued in your last paragraph. 
