# Is there a widespread error/contradiction on whether to use internal or external pressure in computing work done by an expanding gas?

I've been looking at some sample problems involving work done by gas in an irreversible expansion in a piston. They all say $W = P\Delta V$, but some of them say to use internal pressure for $P$, some of them say to use external pressure, and I'm wondering if a large portion of the sources are simply wrong. My argument is that you should use (changing) internal pressure to compute work done by the gas, and (usually constant) external pressure to compute work done by the gas plus the piston. But many sources say to use external pressure to compute work done by the gas, and this sounds incorrect.

Suppose you have gas compressed in a piston at 4 atm, currently volume 1 liter, and the piston is frictionless but held in place by a catch (with normal 1 atm pressure outside). (Edited to add: let's assume the piston is lying on its side so the mass of the piston does not contribute to the internal pressure.) You release the catch and the piston expands to twice its volume (and pressure decreases to 2 atm) where it's caught by another catch. What is the work done by the gas?

Here is my reasoning:

1. If you consider "the system" to be the gas, then the work done by the gas as it expands is the integral of the internal pressure over the change in volume, because the first thing I learned in physics is that work is the integral of force over distance moved.
2. If you consider "the system" to be the piston as a whole, then the work done by the piston is the external pressure times the change in volume. This is the work required to make room in the surroundings for the expanded system.
3. The difference between #1 and #2 is because when the gas expands, it imparts kinetic energy to the piston, and when the piston hits the second latch and locks into place, the kinetic energy gets diffused as heat energy. But that should still count as work that the gas did to get the piston moving, even if the piston lost the kinetic energy when it hit the latch.

(This is similar to the question posted at:
https://physics.stackexchange.com/questions/135175/work-done-against-gravity/135194
where someone asked: if I'm lifting a 10 N weight 1 meter by using a 50 N force, why is the work done only 10 Nm and not 50 Nm? Because if you lift it using a 50 N force, the rest of that work goes into the kinetic energy of the object. Presumably if the object hit something and got locked into place then the kinetic energy would be diffused as heat energy.)

Is my reasoning right so far?

Because then, here are several supposedly reliable sources which all say that the work done by the gas when it expands, is the external pressure times the volume change. My position is that unless it's specified that it's reversible (i.e. external pressure = internal pressure), this is (subtly) incorrect, and you would use external pressure to compute work done by the gas plus the piston, but not the work done by the gas by itself. I found these just by googling "pressure volume work" "work done by the gas", and about half of the results say to use external pressure, and that's what I'm arguing is incorrect. Here are the sources saying to use external pressure; for each document, you can search for the phrase "work done by the gas":

and many more which come up just googling "pressure volume work" "work done by the gas".

As long as work is the integral of force over distance moved, I'm saying that to compute work done by an expanding gas, you use internal pressure (if it's different from external), and these sources are incorrect. Am I missing something?

(To avoid confusion, please specify: (1) do you agree that to compute work done by an irreversibly expanding gas, you use internal pressure, or am I wrong; and (2) if I am right about #1, isn't it also the case that the sources above which say otherwise, are incorrect? If not, why not?)

By Newton's third law, the force exerted by the gas on the piston is equal and opposite to the force that the piston exerts on the gas. So to get the work, either force will do. However, the ideal gas equation of state only applies to equilibrium situations, and, for non-equlibrium situations (such as irreversible expansion or compression), viscous stresses also contribute to the forces and pressures within a gas. So in irreversible processes, the ideal gas law will not give the correct result for the work done by the gas on the piston. Therefore, the only alternative is to use the external pressure exerted on the gas to calculate the work. This is great if you are told what that external pressure is. Otherwise, you're out of luck.

In the case of a reversible expansion or compression, $P_{ext}=P$, and the system is only slightly removed from thermodynamic equilibrium, so you can use PdV to get the work, where P is the equilibrium pressure of the gas. However, in all cases, irrespective of whether the process is reversible or irreversible, you can always use $P_{ext}dV$.

ADDENDUM: A very crude approximation to the compressive stress $P_{int}$ of the gas in the cylinder for both reversible and irreversible processes is given by: $$P_{int}=\frac{nRT}{V}-\eta\frac{1}{V}\frac{dV}{dt}=P_{ext}$$ where $\eta$ is proportional to the gas viscosity, and dV/dt is the rate of change of gas volume with respect to time. So you can see that, for an irreversible process, where the gas volume is changing rapidly, the compressive stress in the gas $P_{int}=P_{ext}$ depends not only on the volume but also on the rate of change of the volume. But, as the rate of change of volume (the second term in the equation) becomes small, the gas behavior approaches that described by the ideal gas law. The viscous term in the equation is a damping factor, and causes any oscillations of the piston in irreversible expansions to die out (in addition to causing deviations from the ideal gas law).

• But even if P(int) is unknown, surely P(int) is what gives the correct answer to the question: "How much work was done by exerting this force to move an object this distance?" If work done equals force exerted times distance moved. Again, it's like the question of taking an object that weighs 10N, and applying a 50N upward force to lift it 1 meter, before it locks into place. The work done by the 50N force is still 50 Nm, isn't it? And some of that is imparted to the object as kinetic energy, and when it locks into place that gets dissipated as heat energy. Jul 7, 2018 at 14:42
• Yes. Even if it is unknown, it nevertheless gives the correct answer to the question. And yes, all the rest of what you said is correct too. Even if it oscillates (rather than locking in place), after the oscillation damps out, the kinetic energy is dissipated, and the work done is still 50N.m. Jul 7, 2018 at 15:03
• Um, OK, but if P(int) != P(ext), if P(int) gives the correct answer, then P(ext) would give the incorrect answer, so what did you mean that "you can always use P(ext)dV"? You can always use it, even though it will sometimes give the incorrect answer? :) Jul 7, 2018 at 16:20
• Using $P_{ext}$ never gives the incorrect answer. For an irreversible process, you can't determine $P_{int}$ using the equation of state, so how can you determine it? What we are saying here is that, at the inner piston face where the work is done, $P_{int}=P_{ext}$, but we can determine $P_{int}$ only for a reversible process. I might also mention that, for an irreversible process, the pressure (as well as the compressive stress, which includes viscous stresses) is not even uniform spatially. So the average value of the internal compressive stress does not equal that at the piston. Jul 7, 2018 at 16:47
• That seems wildly counterintuitive that P(int) would be the same as P(ext) as soon as the piston is un-latched, if P(int) was 4 atm while the piston was still latched. If P(int)=P(ext) then it would seem like the piston wouldn't move. Jul 7, 2018 at 18:23

Here is the short answer to the best of my knowledge, after figuring out what was being said in the subsequent comments and in threads on other sites:

• In the system under the exact conditions that I specified, where the piston is stopped by a latch, the work gone by the gas will indeed be greater than pressure times change in volume.

• In any gas expansion problem where the gas pressure is greater than the outside environmental pressure, generally the work done by the gas, from the moment the gas starts expanding to the moment the gas reaches peak volume, will be greater than pressure times change in volume.

• However, what happens next (and the final answer to the question of "how much work is done by the gas") depends on how the expansion is stopped, and it's possible that the work done by the gas is negative, bringing total work back down to pressure times change in volume. If the piston is stopped by a latch as in my original question, then the gas does no more work and no more work is done on the gas, and the total work done remains greater than pressure times change in volume. But, if the expansion is stopped by other means (i.e., the frictionless piston moves back and forth until the dampening effect from the gas slows it down and stops it), then work is done on the gas (i.e., work done by the gas during that time period is negative), and the total amount of work done by the gas, after the system has stopped moving, is equal to pressure times change in volume.