# Doubt in thermodynamics pressure volume work done derivation

Please tell me where i got wrong with my understanding here:

Consider a cylinder fitted with a frictionless and weightless piston having area of cross section $A$. Let it contain gas of volume $V$ and let the pressure of gas inside the cylinder be $P_{int}$. Let the pressure outside be $P_{ext}$. Now if the external pressure is greater than internal pressure an unbalanced force will try to compress the piston, in the general derivation we take for small compression the force as $P_{ext} \cdot A$ which gives us the final small work done as $P \cdot dV$ but isn't this just due to outside force, the piston moves because of net unbalance force because of pressure from both sides and that means net force should be $F=(P_{ext}-P_{int}) \cdot A$ which gives us small work done as $\Delta P \cdot dV$, $\Delta P$ being the pressure difference between external and internal.

The work done by the gas is given by $W= \int F \cdot dl$, which is $\int PA \cdot dl =\int P dV$. The reason it is not what you have stated is because you are using the net force acting on the piston, when in actuality the work done by the gas is just the product of the force exerted by the gas on the piston and the displacement of the piston in the direction of the force. What happens is that $P_{ext}$ does work given by $P_{ext} dV$. The gas, on the other hand, only does work $-P_{int} dV$.

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.

If the piston is massless and frictionless,then, by Newton's 2nd law, the force that the gas exerts on the inside face of the piston is always exactly equal to the force that the external surroundings exert on the outside face of the piston: $$F_{g,int}=P_{ext}A\tag{1}$$where A is the area of the piston. This equation applies irrespective of whether the process is reversible or irreversible. However, if the the process is reversible, the gas force at the inside face of the piston is also equal to that given by the ideal gas law: $$F_{g,int}=\frac{nRT}{V}A\tag{reversible only}$$

For an irreversible process, where the gas volume is changing very rapidly (although not infinitely fast), the situation is much more complicated because the ideal gas law only applies to a system that is close to thermodynamic equilibrium. In a case of very rapid volume change, one must also consider the inertia of the gas (as characterized by its distributed mass) as well as the occurrence of viscous stresses that develop in the gas when it is deformed rapidly. With these physical factors present, the pressure and temperature of the gas are not even spatially uniform within the cylinder, so that there is not one single value for either the pressure or the temperature that applies. So, in short, the ideal gas law does not describe the behavior of a gas that is experiencing an irreversible process.

So what do we do in the case of an irreversible process? Well, for an irreversible process, Eqn. 1 still applies. So, if we can manually control $P_{ext}$ from the outside (say, as a function of time or of volume), we can still calculate the amount of work that is done by the gas on the piston: $$W=\int{F_{g,int}dx}=\int{P_{ext}dV}$$ One kind of irreversible process that we can impose externally, for example, is one involving a constant external force that we impose using an automatic control system in conjunction with a flush-mounted pressure transducer in the piston face. Another irreversible process we can impose is one in which there is initially a weight on the top side of the piston, and, at time zero, we suddenly remove part of the weight; when the system re-equilibrates, the net amount of work done will be equal to the weight remaining on the piston times the change in volume divided by the cross sectional area of the piston.