Tutorials › Calculus I › Pressure-Volume Work in a Cylinder

Work and Geometric Applications · Tutorial 1323 of 1495

Pressure-Volume Work in a Cylinder

Learn how piston force leads to a pressure-volume integral and how its sign records whether the gas expands or is compressed.

Advanced 9 min read

What You'll Learn

  • Derive the relation between piston displacement and volume change.
  • Define work done by a gas and work done on a gas using consistent signs.
  • Integrate constant and variable pressure-volume relations.
  • Interpret compression and expansion through the integral’s bounds.
  • Check results using units, endpoint pressures, and antiderivatives.

From Piston Force to Pressure-Volume Work

A gas in a cylinder can move a piston by expanding, or have work done on it by compression. The force comes from pressure acting over the piston face. Because the piston moves as the volume changes, the resulting work is naturally expressed in terms of pressure and volume.

The key sign convention is that work done by the gas is positive when the gas expands. During compression, work done by the gas is negative; work done on the gas is then positive. Keeping these two quantities distinct prevents a common sign error.

Deriving the Pressure-Volume Formula

Consider a cylinder with a straight piston whose face has constant area \(A\). Let \(x\) measure the piston’s position in the direction that increases the gas volume. If the gas occupies a length \(x\) of the cylinder, its volume is \(V=Ax\), up to any fixed volume offset. Therefore, a small piston displacement \(dx\) changes the volume by \(dV=A\,dx\).

Pressure is force per unit area. If the pressure exerted by the gas on the piston face is \(P\), the force exerted by the gas has magnitude \(PA\) and points in the direction of increasing volume. The small amount of work done by the gas is force times displacement in that direction. Substituting \(dV=A\,dx\) gives the differential work relation.

$$ dW_{\text{by}}=(PA)\,dx=P(A\,dx)=P\,dV. $$

If the pressure varies as the piston moves, add the small contributions along the entire process. When the boundary pressure is described by a continuous function \(P(V)\) on the volume interval from \(V_1\) to \(V_2\), the definite integral gives the total work done by the gas. Work done on the gas has the opposite sign.

Definition: For a process from volume \(V_1\) to volume \(V_2\), with boundary pressure \(P(V)\), work done by the gas is \(W_{\text{by}}=\int_{V_1}^{V_2}P(V)\,dV\). Work done on the gas is \(W_{\text{on}}=-W_{\text{by}}=-\int_{V_1}^{V_2}P(V)\,dV\). These formulas assume the pressure-volume relation describes the process and the integral exists.

The integral is signed: its bounds record the direction of the volume change. For positive pressure, expansion has \(V_2>V_1\), so work by the gas is positive. Compression has \(V_2<V_1\), so work by the gas is negative and work on the gas is positive. Pressure must be a boundary pressure appropriate to the process. In a quasistatic process, the gas pressure at the piston can be used as this pressure. If instead the task specifies the work against an external pressure, use that pressure in the work calculation.

Why the Integral Gives Total Work

The formula follows by approximating the piston’s motion with many small displacements. Over a short step, the pressure is nearly constant, so the work by the gas is approximately the pressure at that step multiplied by the small change in volume. Adding these contributions produces a sum of pressure times volume change. As the steps become arbitrarily small, this sum approaches the definite integral.

$$ \sum_{i=1}^{n} P(V_i^*)\,\Delta V_i \ \longrightarrow\ \int_{V_1}^{V_2}P(V)\,dV. $$

This also explains why the pressure must be specified along the process, not merely at its endpoints. Different pressure-volume relations between the same starting and ending volumes can give different integrals, and therefore different work.

Worked Examples

Worked Example: Expansion at Constant Pressure

A gas expands in a cylinder with piston area \(0.020\ \text{m}^2\), from \(0.010\ \text{m}^3\) to \(0.025\ \text{m}^3\). The pressure is constant at \(150\ \text{kPa}\). Find the work done by the gas and the work done on the gas.

First convert the pressure to pascals and find the volume change:

$$ P=150\ \text{kPa}=150{,}000\ \text{Pa}, \qquad \Delta V=0.025-0.010=0.015\ \text{m}^3. $$

Since the pressure is constant, integrate it over the volume interval:

$$ W_{\text{by}} =\int_{0.010}^{0.025}150{,}000\,dV =150{,}000(0.025-0.010) =2{,}250\ \text{J}. $$

The work done on the gas is the negative of this value:

$$ W_{\text{on}}=-2{,}250\ \text{J}. $$

Check by using the piston displacement. The displacement is \(\Delta x=\Delta V/A=0.015/0.020=0.75\ \text{m}\). The force is \(PA=150{,}000(0.020)=3{,}000\ \text{N}\), so the work is \(3{,}000(0.75)=2{,}250\ \text{J}\), as before. The units also agree: \(\text{Pa}\cdot\text{m}^3=(\text{N}/\text{m}^2)\text{m}^3=\text{N}\cdot\text{m}=\text{J}\).

Worked Example: Expansion with Pressure Inversely Proportional to Volume

Suppose a gas follows the relation \(P(V)=600/V\), where \(V\) is measured in cubic metres and \(P\) in pascals. It expands from \(0.010\ \text{m}^3\) to \(0.030\ \text{m}^3\). Find the work done by the gas.

The pressure-volume constant is \(600\ \text{Pa}\cdot\text{m}^3=600\ \text{J}\). The endpoint pressures are \(P(0.010)=600/0.010=60{,}000\ \text{Pa}\) and \(P(0.030)=600/0.030=20{,}000\ \text{Pa}\). Integrate the given pressure relation:

$$ W_{\text{by}} =\int_{0.010}^{0.030}\frac{600}{V}\,dV =600\big[\ln V\big]_{0.010}^{0.030} =600\ln\!\left(\frac{0.030}{0.010}\right) =600\ln 3\ \text{J}. $$

Numerically, \(600\ln 3\approx659.2\ \text{J}\). Since this is an expansion, the positive sign is consistent with the convention. Work done on the gas is \(-600\ln 3\ \text{J}\), approximately \(-659.2\ \text{J}\).

Check the antiderivative: the derivative of \(600\ln V\) with respect to \(V\) is \(600/V\), exactly the given pressure. The result has units of joules because the factor \(600\) has units \(\text{Pa}\cdot\text{m}^3\), while the logarithm is dimensionless as a ratio of volumes.

Worked Example: Compression with Linearly Varying Pressure

During compression, the pressure is described by \(P(V)=160{,}000-2.00\times10^6V\), with \(V\) in cubic metres and \(P\) in pascals. The volume decreases from \(0.020\ \text{m}^3\) to \(0.010\ \text{m}^3\). Find the work done by the gas and the work done on the gas.

Check the pressures at the endpoints:

$$ P(0.020)=160{,}000-(2.00\times10^6)(0.020)=120{,}000\ \text{Pa}, $$ $$ P(0.010)=160{,}000-(2.00\times10^6)(0.010)=140{,}000\ \text{Pa}. $$

The pressure is positive throughout the interval and rises as the volume decreases. An antiderivative of \(P(V)\) is \(F(V)=160{,}000V-1.00\times10^6V^2\). Evaluate it at both bounds, retaining the compression order \(0.020\) to \(0.010\):

$$ F(0.010)=160{,}000(0.010)-(1.00\times10^6)(0.010)^2 =1{,}600-100=1{,}500\ \text{J}, $$ $$ F(0.020)=160{,}000(0.020)-(1.00\times10^6)(0.020)^2 =3{,}200-400=2{,}800\ \text{J}, $$ $$ W_{\text{by}}=F(0.010)-F(0.020) =1{,}500-2{,}800=-1{,}300\ \text{J}. $$

Therefore, \(W_{\text{on}}=-W_{\text{by}}=1{,}300\ \text{J}\). Check by differentiating the antiderivative: \(F'(V)=160{,}000-2.00\times10^6V=P(V)\). The negative work by the gas is appropriate because the volume decreases; the positive work on the gas has the expected sign.

Sign Convention and Common Pitfall

A reliable way to track signs is to keep the initial and final volumes in their actual order in the integral. Do not rearrange the bounds merely to make them increasing. If you reverse them, the integral changes sign, so the result no longer represents work by the gas for the stated process.

Common mistake: For compression from \(0.020\ \text{m}^3\) to \(0.010\ \text{m}^3\) under positive pressure, writing \(W_{\text{by}}=\int_{0.010}^{0.020}P(V)\,dV\) gives a positive value. Those are reversed bounds: that integral represents the expansion direction. Use \(W_{\text{by}}=\int_{0.020}^{0.010}P(V)\,dV\), which is negative, and then \(W_{\text{on}}=-W_{\text{by}}\), which is positive.

Another potential confusion is whether to use the pressure of the gas or the pressure of the surroundings. The work done by the gas at its boundary uses the pressure exerted by the gas there. A problem asking for work against an external pressure calls for that specified external pressure. In quasistatic equilibrium these pressures agree; otherwise, keep the physical quantity in the question clear.

Using the Model Carefully

Before integrating, identify the process direction and the pressure relation that applies over the entire interval. Then preserve the given units consistently: pressure in pascals and volume in cubic metres produce work in joules. If the pressure is constant, the integral reduces to pressure multiplied by the signed volume change. If pressure varies, use the stated function and evaluate its definite integral with the actual starting and ending volumes.

1
Identify the boundary pressure.
Use the pressure specified for the gas at the moving piston, or the external pressure if the requested quantity is work against the surroundings.
2
Record the direction.
Write \(V_1\) as the lower-limit position in time and \(V_2\) as the upper-limit position in time, even when \(V_2<V_1\).
3
Integrate and interpret.
Compute \(W_{\text{by}}=\int_{V_1}^{V_2}P(V)\,dV\); negate it to obtain work done on the gas.
4
Check the result.
Verify the antiderivative, units, and sign against whether the gas expanded or was compressed.

Check Your Understanding

Use the pressure-volume work convention from this tutorial to answer the following questions.

  1. Why does a piston of area \(A\) moving by \(dx\) produce a volume change \(dV=A\,dx\)?
  2. A gas expands under constant positive pressure. What are the signs of work done by the gas and work done on the gas?
  3. For \(P(V)=k/V\), what antiderivative should be used to calculate work, and what condition on \(V\) is needed?
  4. During compression, why must the limits in the work-by-the-gas integral be written from the larger initial volume to the smaller final volume?
  5. What information about the process is needed to determine pressure-volume work when pressure is not constant?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon