THERMODYNAMICS • FIRST LAW OF THERMODYNAMICS

Boundary Work & P-v Diagrams — Compute boundary work for common processes (P–v diagrams)

Quantify the energy transferred as a system's boundary moves against its surroundings using pressure–volume relationships.

Historical Context & Motivation

The concept of boundary work arose from humanity's centuries-long effort to harness the expansion of gases for mechanical power. Long before thermodynamics existed as a formal discipline, engineers and natural philosophers observed that heated steam could push a piston, converting thermal energy into useful motion. The intellectual challenge lay in quantifying exactly how much work a gas performs as it expands or compresses inside a cylinder—a question that ultimately demanded a graphical language for pressure and volume relationships. The P–v diagram became that language, serving as both a computational tool and a conceptual map for every quasi-static process a closed system can undergo.

1679
Denis Papin's Steam Digester
Papin demonstrates that confined steam can raise a piston, foreshadowing the piston–cylinder apparatus central to boundary-work analysis.
1796
Watt's Indicator Diagram
James Watt and John Southern develop the steam-engine indicator, mechanically tracing pressure versus volume during each stroke—the first experimental P–v diagram. The enclosed area directly measured the work output per cycle.
1824
Carnot's Reflections
Sadi Carnot publishes his treatise on the motive power of fire, idealizing engine cycles on P–v coordinates and establishing that the net work of a cycle equals the area enclosed by its process curves.
1850
Clausius & the First Law
Rudolf Clausius formally states the first law of thermodynamics, embedding boundary work (∫P dV) into the energy balance for closed systems and giving the P–v diagram its rigorous mathematical foundation.

From Watt's mechanical pen tracing loops on paper cylinders to modern computational simulations, the core question has remained the same: given a process path on a P–v diagram, how do we compute the boundary work exchanged between a system and its surroundings? Answering this question is essential to applying the first law to pistons, compressors, turbines, and every other device whose operation involves a moving boundary.

Core Principles & Definitions

Before computing boundary work for any specific process, it is essential to ground yourself in a handful of foundational ideas. These principles govern what boundary work is, when it applies, and how the P–v diagram encodes it geometrically. Every formula you encounter later in this lesson is a direct consequence of the definitions and conventions introduced here.

1

Boundary Work Defined

Boundary work (Wb) is the energy transfer that occurs when a system boundary—typically a piston face—moves under a pressure differential. It is given by the integral Wb = ∫P dV evaluated along the process path.
2

Sign Convention

Expansion (dV > 0) yields positive boundary work: the system does work on its surroundings. Compression (dV < 0) yields negative boundary work: the surroundings do work on the system. This convention is consistent with the first-law form Q − W = ΔU.
3

Quasi-Static Assumption

The integral ∫P dV is only valid when the process proceeds slowly enough for the system to pass through a continuous sequence of equilibrium states. Only then is the system pressure P well-defined at every instant. Rapid, irreversible expansions cannot be described by a single P–v path.
4

Path Dependence

Boundary work is a path function, not a state function. Two different process paths connecting the same initial and final states will, in general, produce different amounts of work. This is why specifying the process type (isobaric, isothermal, polytropic, etc.) is critical.
5

Area Under the Curve

On a P–v diagram, the boundary work for any quasi-static process equals the area under the process curve projected down to the volume axis. For a cyclic process, the net work equals the area enclosed by the cycle's loop.
KEY TAKEAWAY
Think of boundary work like the toll a traveler pays to cross a mountain range: the cost depends not just on the starting and ending cities, but on which road is taken. A high-altitude pass (high-pressure expansion path) costs more energy than a low-altitude tunnel (low-pressure path), even if both connect the same two towns. Similarly, the amount of work a gas exchanges with its surroundings depends entirely on the specific pressure–volume path the process follows.

Visual Explanation — The P–v Diagram

The pressure–specific volume diagram (P–v diagram) is the fundamental graphical workspace for visualizing boundary work in closed systems. Pressure is plotted on the vertical axis and specific volume on the horizontal axis, although total volume V may be used when working with a fixed mass. Each quasi-static process traces a curve on this plane, and the area beneath that curve—bounded by the volume axis—represents the boundary work per unit mass.

A generic expansion process from state 1 to state 2 on a P–v diagram. The shaded area beneath the process curve represents the boundary work per unit mass. For expansion (v₂ > v₁) the work is positive; the system pushes its boundary outward.

Several important features deserve emphasis. First, the process curve connecting states 1 and 2 is entirely determined by the thermodynamic relationship that governs the process—whether pressure stays constant, temperature stays constant, or some polytropic relation PVn = constant holds. Second, the area under the curve has physical meaning only when the process is quasi-static; for a free expansion into a vacuum, the system pressure is not uniform, and no well-defined curve exists. Third, because work is a path function, different curves connecting the same two endpoints yield different areas—and therefore different amounts of boundary work. This geometric interpretation makes the P–v diagram an indispensable tool for comparing processes at a glance.

Mathematical Framework

The general boundary-work integral takes the same form for every quasi-static process. The challenge lies in expressing pressure as a function of volume (or specific volume) so the integral can be evaluated analytically. Below we present the master formula and then specialize it to the four most common process types encountered in introductory thermodynamics.

GENERAL BOUNDARY WORK
W_b = ∫₁² P dV
Wb = boundary work (kJ); P = system pressure (kPa); V = total volume (m³). For specific (per-unit-mass) quantities, replace V with v and Wb with wb.

Isobaric Process (P = constant)

ISOBARIC WORK
W_b = P(V₂ − V₁)
When pressure is constant throughout the process, P factors out of the integral, leaving a simple product of pressure and volume change. On the P–v diagram this is the area of a rectangle.

Isochoric Process (V = constant)

ISOCHORIC WORK
W_b = 0
If the volume does not change (dV = 0), no boundary displacement occurs and the integral vanishes. On the P–v diagram, an isochoric process is a vertical line, which has zero area beneath it in the volume direction.

Isothermal Process (T = constant, Ideal Gas)

ISOTHERMAL WORK (IDEAL GAS)
W_b = P₁V₁ ln(V₂ / V₁) = mRT ln(V₂ / V₁)
For an ideal gas at constant temperature, PV = mRT = constant. Substituting P = mRT/V into the integral and integrating yields the natural-log expression. Equivalently, Wb = P₁V₁ ln(V₂/V₁) since P₁V₁ = mRT.

Polytropic Process (PVⁿ = constant)

POLYTROPIC WORK (n ≠ 1)
W_b = (P₂V₂ − P₁V₁) / (1 − n)
Here n is the polytropic exponent. This general formula reduces to the isobaric case when n = 0 and to the isothermal ideal-gas case in the limit n → 1 (where the ln form must be used instead). When n = k (ratio of specific heats), the process is isentropic.
⚠️ Sign Check
Always verify the sign of your answer against physical intuition. If the gas expands (V₂ > V₁), boundary work should be positive. If the gas is compressed (V₂ < V₁), boundary work should be negative. For the isothermal formula, note that ln(V₂/V₁) < 0 when V₂ < V₁, automatically yielding a negative result for compression.

Comparing Common Processes on the P–v Diagram

One of the most powerful aspects of the P–v diagram is its ability to display multiple processes on the same axes, making it immediately apparent which process delivers more or less boundary work between the same initial and final volumes. The diagram below overlays four fundamental process types—isobaric, isothermal, polytropic, and isentropic (adiabatic)—all starting from the same state 1 and expanding to the same final specific volume v₂.

Four expansion processes starting from the same state 1 and reaching the same final specific volume v₂. The isobaric process (horizontal line, n = 0) produces the most boundary work because its curve is highest, enclosing the greatest area. The isentropic process (n = k) drops most steeply, producing the least work among these four.
Summary of common quasi-static processes and their boundary-work formulas
ProcessConstraintP–v Curve ShapeWork Formula
IsobaricP = constHorizontal lineW = P(V₂ − V₁)
IsochoricV = constVertical lineW = 0
Isothermal (ideal gas)T = constRectangular hyperbola (PV = const)W = P₁V₁ ln(V₂/V₁)
PolytropicPVn = constCurve steepness set by nW = (P₂V₂ − P₁V₁)/(1 − n)
Isentropic (ideal gas)PVk = const, s = constSteeper than isothermalW = (P₂V₂ − P₁V₁)/(1 − k)

Worked Example — Polytropic Expansion of Air

A piston–cylinder device contains 0.5 kg of air (ideal gas, R = 0.287 kJ/(kg·K)) at an initial state of P₁ = 400 kPa and T₁ = 500 K. The air undergoes a polytropic expansion with n = 1.3 to a final pressure of P₂ = 100 kPa. Determine the boundary work produced during this process.

Polytropic Expansion (n = 1.3)
1
Step 1 — Identify the Given Informationm = 0.5 kg, R = 0.287 kJ/(kg·K), P₁ = 400 kPa, T₁ = 500 K, P₂ = 100 kPa, n = 1.3. We seek Wb for this polytropic process.
2
Step 2 — Compute the Initial Volume V₁From the ideal-gas law: V₁ = mRT₁ / P₁ = (0.5)(0.287)(500) / 400 = 71.75 / 400
V₁ = 0.17938 m³
3
Step 3 — Find V₂ Using the Polytropic RelationThe polytropic relation gives P₁V₁ⁿ = P₂V₂ⁿ, so V₂ = V₁ × (P₁/P₂)1/n. Substituting: V₂ = 0.17938 × (400/100)1/1.3 = 0.17938 × (4)0.7692 = 0.17938 × 3.0314
V₂ = 0.5439 m³
4
Step 4 — Compute P₂V₂ and P₁V₁P₁V₁ = 400 × 0.17938 = 71.75 kJ. P₂V₂ = 100 × 0.5439 = 54.39 kJ.
5
Step 5 — Apply the Polytropic Work FormulaWb = (P₂V₂ − P₁V₁) / (1 − n) = (54.39 − 71.75) / (1 − 1.3) = (−17.36) / (−0.3)
W_b = 57.87 kJ
6
Step 6 — Verify Sign and ReasonablenessThe result is positive, consistent with an expansion (V₂ > V₁). The gas did approximately 57.9 kJ of boundary work on its surroundings. We can also verify T₂ using the ideal-gas law: T₂ = P₂V₂/(mR) = 54.39/(0.5 × 0.287) ≈ 379 K, confirming the gas cooled during expansion, as expected for a polytropic process with n > 1.

Strengths, Limitations & Practical Considerations

The P–v framework and the ∫P dV formulation of boundary work are elegant and powerful, but they carry assumptions that can trip up students and practicing engineers alike. Understanding these constraints is just as important as memorizing the formulas.

Strengths and limitations of the boundary-work / P–v diagram framework
StrengthsLimitations
Provides an intuitive geometric interpretation—work equals area under the curve—that aids both conceptual understanding and quick estimation.Strictly valid only for quasi-static (internally reversible) processes. Rapid or violent processes do not have a single well-defined pressure throughout the system.
Closed-form analytical solutions exist for all common process types (isobaric, isothermal, polytropic), enabling fast hand calculations.Requires knowledge of the process path (value of n, equation of state) in advance. In real experiments the path may not follow a simple analytical relation.
Net cycle work is immediately visible as the enclosed area on the P–v diagram, facilitating cycle analysis.Does not capture other work modes (electrical, magnetic, shaft work). Boundary work is only one component of total work in the first-law energy balance.
Applicable to any pure substance (ideal gas, real gas, two-phase mixtures) as long as the process is quasi-static.For non-ideal gases, evaluating ∫P dV may require numerical integration with tabulated property data rather than simple closed-form expressions.
KEY TAKEAWAY
The ∫P dV integral is the thermodynamic equivalent of calculating the area of an irregularly shaped plot of land on a surveyor's map. Just as a surveyor must know the exact boundary lines (the process path), you must know the exact pressure–volume relationship to compute the work. Without that path information, you can identify the endpoints of the journey but cannot determine the energy cost of getting there—a direct consequence of work being a path function.

Connection to the First Law & Advanced Cycle Analysis

Boundary work does not exist in isolation—it is one side of the energy-balance equation that defines the first law of thermodynamics for a closed system. Once you can compute Wb, you can determine heat transfer Q or internal-energy change ΔU if the other quantity is known. This section links boundary work to the broader thermodynamic framework and shows where the concept leads at higher levels of study.

FIRST LAW — CLOSED SYSTEM
Q − W_b = ΔU = m(u₂ − u₁)
Q = net heat transfer (kJ); Wb = net boundary work (kJ); ΔU = change in internal energy (kJ); u = specific internal energy (kJ/kg).
From single-process boundary work to full cycle analysis
This LessonAdvanced Extension
Boundary work for a single process between two states (open integral ∫₁² P dV)Net work for complete power cycles (Carnot, Otto, Diesel, Brayton) computed as the enclosed area ∮ P dV on P–v diagrams
Ideal-gas equation of state used for analytical integrationReal-gas equations of state (van der Waals, Redlich-Kwong) or steam tables for non-ideal substances
Quasi-static processes only; work computed from system pressureActual (irreversible) work estimated via isentropic efficiencies, η = W_actual / W_isentropic
P–v diagram used for boundary-work visualizationT–s diagram used to visualize heat transfer (Q = ∫T ds); combined with P–v for full cycle analysis

Mastering boundary-work computations for individual processes is the essential prerequisite for cycle analysis. In courses on power-plant engineering or internal-combustion engines, you will chain together isentropic compressions, constant-volume heat additions, and isentropic expansions (as in the Otto cycle) and compute net cycle work by summing the boundary work of each process—or equivalently, by computing the area enclosed by the cycle on the P–v diagram. Comfort with the formulas and sign conventions established in this lesson will make those more complex analyses far more tractable.

Practice Problems

PROBLEM 1CONCEPTUAL
Two quasi-static expansion processes connect the same initial state 1 and final state 2 on a P–v diagram. Process A follows a straight line from 1 to 2, while Process B follows a convex curve that bulges above the straight line. Which process produces more boundary work, and why?
PROBLEM 2BASIC CALCULATION
A gas in a piston–cylinder device expands isobarically at P = 200 kPa from V₁ = 0.05 m³ to V₂ = 0.15 m³. Calculate the boundary work in kJ.
PROBLEM 3INTERMEDIATE
An ideal gas (m = 2 kg, R = 0.287 kJ/(kg·K)) undergoes an isothermal compression at T = 350 K from V₁ = 0.8 m³ to V₂ = 0.2 m³. Determine the boundary work and state whether work is done by or on the gas.
PROBLEM 4APPLIED
Air (ideal gas, R = 0.287 kJ/(kg·K), k = 1.4) in a cylinder at P₁ = 500 kPa and T₁ = 600 K undergoes an isentropic expansion to P₂ = 100 kPa. The cylinder contains 0.3 kg of air. (a) Find V₁ and V₂. (b) Calculate the boundary work. (c) Determine T₂.
PROBLEM 5CRITICAL THINKING
A gas undergoes two sequential processes: Process A is an isobaric expansion at P = 300 kPa from V₁ = 0.1 m³ to V₂ = 0.4 m³, followed by Process B, an isochoric pressure drop from P₂ = 300 kPa to P₃ = 100 kPa at V = 0.4 m³. A colleague claims the total boundary work equals the area of the trapezoid formed by drawing a straight diagonal line from state 1 (300 kPa, 0.1 m³) to state 3 (100 kPa, 0.4 m³). Is this claim correct? Justify your answer quantitatively.

Summary — Boundary Work & P–v Diagrams

Boundary work is the energy transferred when a system boundary moves under a pressure differential, computed as W_b = ∫P dV for any quasi-static process. On a P–v diagram, this integral corresponds to the area under the process curve. Because work is a path function, different process paths between the same two states yield different work values—making it essential to identify the process type before integrating.

The four canonical processes are: isobaric (W = PΔV), isochoric (W = 0), isothermal (W = P₁V₁ ln(V₂/V₁) for an ideal gas), and polytropic (W = (P₂V₂ − P₁V₁)/(1 − n) for n ≠ 1). The sign convention assigns positive work to expansions and negative work to compressions. Mastery of these formulas and their geometric meaning on P–v diagrams is the foundation for first-law energy balances and subsequent cycle analysis.

Varsity Tutors • Thermodynamics • Boundary Work & P-v Diagrams