Why is work done equal to $-pdV$ only applicable for a reversible process? In thermodynamics, when we're interested at gases, I know that the work done can be written to be $-pdV$ for a reversible process ($p$ is the pressure of the system, and $V$ is the volume of the system).
This is because $$dW=Fdx=-pAdx=-pd(Ax)=-pdV$$
However, why is it not true also that the work done is $-pdV$ for non-reversible processes as well?
 A: In a quasistatic process (reversible), the difference between the external pressure and the internal pressure is infinitesimal for each infinitesimal change in the volume of the system.
$P_{ext}=P_{int} \pm dP $,
As you know that the term for work in terms of pressure is given by, $dW=PdV$. This means that work obtained will be maximum if the pressure is maximum for each infinitesimal change in volume. 
In a reversible process, the work done in each step obtained is maximum since the external pressure in only infinitesimally greater (or smaller) than the internal pressure.
This enables us to connect the internal pressure and external pressure (since they are almost equal) using the ideal gas law, which in turn enables us to derive work in terms of volume change, without knowing the pressure.
$P_{int}V=nRT$
$W_{int}=\int_{v_1}^{v_2} P_{int}dV$
$W_{int}=nRT\int_{v_1}^{v_2} \frac{dV}{V}$
For non-reversible process, such thing is not possible. This process is instantaneous. Internal pressure won't have enough time to become almost equal to external pressure. Only, external pressure is a way to find the work. The work done by internal pressure and external pressure are equal in magnitude. For some processes, external pressure is given. We can either simply calculate the work done by using external pressure and volume change or use to ideal gas equation to remove the pressure term. But the latter is won't be possible, since you do not know how the internal pressure is changing. In case of reversible processes, you had the ideal gas equation to give you a relation between pressure and volume.
Hence, we use the constant external pressure (when you put a weight on the piston you get constant external pressure) to calculate the work. 
Therefore, for non-reversible processes,
$W=P_{ext}(V_f-V_i)$
Moreover, work done by a particular pressure is not $\Delta P dV$. For instance, when there are two forces acting on a body the work done by a particular force is not given by the the work done by the net of the two forces but instead the work done by a particular force is given by that force's magnitude and the displacement of the body in that force's direction. 
A: 
why is it not true also that the work done is for non-reversible processes as well?

The general expression for infinitesimal work done by contact pressure forces on a system inside a closed boundary surface is actually
$$
-p_{ext}dV
$$
where $p_{ext}$ is the external pressure. This follows from mechanics, where net work done on a system of mass particles by external forces (after particles of the system undergo displacements $d\mathbf{r}_a$) is
$$
\sum_a \mathbf{F}^{ext}_{-a} \cdot d\mathbf{r}_a
$$
where $\mathbf{F}^{ext}_{-a}$ is force due to all particles that are not part of the system acting on the particle of the system $a$. This can be adapted to the macroscopic description with walls and pistons, the forces are replaced by pressure, and the displacements by change of volume.
One things remains: the pressure is that of external agents, the change of volume is that of system.
If the process is reversible at each stage, the system can be ascribed internal pressure $p$ that has the same value as the external pressure $p_{ext}$. Then it is possible to write the work as
$$
-pdV.
$$
However, in case the process is not so reversible, there may be stages of it where the system does not have single pressure $p$ (imagine the gas is moving inside the enclosure in a turbulent fashion; there is no single pressure, but it depends on the position). Then we cannot express the work as a function of $p$. We can still use the general formula with $p_{ext}$ though.
A: Suppose that gas of pressure $p$ is contained in a vessel behind a piston of area $A$. In order to get the piston to move you will have to supply an external force
$$
f = p A + \epsilon
$$
where $\epsilon$ is the force due to friction, or anything else that prevents the piston from moving freely. Hence the work done on the system when the piston moves in through a distance $dx$ is
$$
dW = f dx = p A dx + \epsilon dx
$$
The change in volume of the gas is
$$
dV = - A dx
$$
so we have
$$
dW = - pdV + \epsilon dx .
$$
So there is your answer. The work is not $-pdV$ because it never was $-pdV$ in the first place. Rather, that is the answer you get in the limit where the friction (or similar) term is negligible. That limit corresponds to a reversible process because reversibility means that an infinitesimal reduction in applied force will suffice to get the process to change direction. This happens when $f$ and $pA$ are balanced, such that a tiny change in either would be sufficient to make the piston begin to move in or out, and this condition corresponds to $\epsilon = 0$.
Notice that we do not need to invoke either the ideal gas or the notion of external pressure in order to present the reasoning. The result is general.
A: Please note that work is always $-pdV$ irrespective of any method. It is valid for reversible as well as irreversible.  But then how to obtain full expression for work?  The expression $-pdV$ represents the infinitesimal quantity of work.  So we need to get finite quantity of work.  So, we need to look one step forward: whether the external pressure is constant or variable.  If it is constant, we get full work as $-p(V_{\text{final}} - V_{\text{initial}})$; meant for irreversible process.
If the external pressure is variable, we obtain the expression from integration.  This is meant for reversible process.  In the reversible case, the external pressure is considered slightly smaller than internal pressure. Mathematically, them are considered same and used any one in the expression. 
