See also: Course-wide Conventions & Notation
Run the code: Notebook for Section 3.1, in which you can change and rerun the Python cells of this section in your browser.
The course map shows where this module sits in the course and which relations connect the microscopic and macroscopic descriptions. Select a module to unfold its sections.

Overview and Learning Objectives¶
Every chemical reaction either absorbs or releases energy—but where does that energy go, and how do we keep track of it? The First Law of Thermodynamics provides the bookkeeping framework. Its origins lie in 19th-century efforts to understand the relationship between mechanical work and heat, and its consequences reach into every area of chemistry: reaction energetics, calorimetry, materials processing, and beyond.
This section motivates the First Law from historical measurements, introduces sign conventions, and catalogs common forms of work as generalized force–displacement pairs.
Learning objectives:
State the First Law in finite and differential forms and recognize that and are path functions while is a state function.
Apply sign conventions to determine whether heat/work is done on or by the system.
Compute work for expansion/compression under specified external pressure conditions.
Identify the generalized force and generalized displacement for a given work mode and write the corresponding expression.
Core Ideas and Derivations¶
Conservation of Mechanical Energy¶
Between 1732 and 1736, Bernoulli and Euler combined the discoveries of Newton (laws of motion) and Leibniz (the connection between weight × vertical displacement and weight × velocity squared) into an early form of the law of conservation of mechanical energy. A simple example is the interchange between potential and kinetic energy:
When an object of mass is dropped from a height , its gravitational potential energy is converted into kinetic energy , assuming negligible air resistance.
Mechanical Equivalent of Heat¶

Figure 3.1.2:Joule’s apparatus for measuring the mechanical equivalent of heat. The falling weights turn a paddle wheel immersed in water, converting a known amount of mechanical work into a measurable temperature rise. Modern calorimeters (Section 3.3) use the same principle—measuring temperature changes to quantify energy transfers—but with electrical heating in place of falling weights. Engraving from Harper’s New Monthly Magazine (1869), via Wikimedia Commons (public domain).
In the 1840s, James Prescott Joule measured how mechanical work converts into heat. In the paper that reports his final experiments, he concluded that of mechanical work (done by falling weights that turn a paddle in water) raises the temperature of 1 lb of water by Joule, 1850. The modern value is , which is above Joule’s. Converting the modern value to SI units:
Here, is the specific heat of water—i.e., the heat capacity per gram. The specific heat of water varies slightly with temperature; at it is , the value used in Section 3.3.
First Law of Thermodynamics¶
Joule’s result showed that a definite quantity of mechanical work always produces the same quantity of heat. This interconvertibility means we need a single energy-conservation statement that accounts for both. To include heat () and work () in one statement of energy conservation for a closed system (one that exchanges energy but not matter with its surroundings), we write
where
is the change in internal energy,
is the heat absorbed by the system,
is the work done on the system.
Some textbooks instead define as the work done by the system, so the sign convention of a source should be checked before one of its formulas is used.
Differential Form¶
In differential form,
Rearranging,
This rearranged form is useful because we often want to find the heat exchanged in a process. Since is a state function (calculable from state variables alone) and we can often evaluate from the process path, we can determine by difference.
Types of Work¶
In Section 1.1, we defined work as “energy transferred when a force acts over a distance.” Mathematically:
Many physical processes fit a “generalized force” “generalized displacement” pattern:
Table 3.1.1:Common forms of work as generalized force–displacement pairs
Generalized “Force” | Generalized “Displacement” | Example | |
|---|---|---|---|
Mechanical | Lifting a weight | ||
Tension | Extension | Stretching a spring ( for a Hookean spring) | |
Surface tension | Blowing a soap bubble | ||
Pressure | Compressing a gas | ||
Chemical potential (Section 6.1) | Number of molecules | Adding molecules to the system | |
Electrical | Charge | Moving an electric charge |
In this course, work will be our workhorse, but the generalized structure shows up again when we discuss surface phenomena, electrochemistry, and chemical potentials. The chemical term applies when molecules enter or leave the system, which is then open rather than closed.
The expression for work follows from the definition of work. Consider a gas in a cylinder that is closed by a piston of area . The surroundings exert the external pressure on the piston, which is a force directed into the gas. When the piston moves inward by a distance , the surroundings do the work on the gas. The volume of the gas changes by , so
The external pressure equals the pressure of the gas only when the gas remains in mechanical equilibrium with its surroundings throughout the process. This is the case for the reversible processes defined in Section 3.2, for which .
Calculating Work¶
The examples below apply the generalized force–displacement framework from Table 3.1.1 to three different work modes: work, surface-tension work, and elastic (spring) work.
Example 1. Expanding Against Constant Pressure¶
Calculate the work when an ideal gas expands from to against a constant external pressure of .
Solution
Convert Units to SI
Set Up the Work Integral
For a constant external pressure,Perform the Integration
Numerical Result
Interpretation
The negative sign indicates the system (gas) does of work on the surroundings.
According to the convention , if no heat is exchanged (), the gas would lose in internal energy because it expands.
Figure 3.1.3 shows this process on a – diagram. The magnitude of the work equals the shaded area under the constant-pressure line.
Source
import sys
import matplotlib.pyplot as plt
import numpy as np
sys.path.append("..") # the book folder, which holds figstyle
import figstyle as fs
V_i = 20 # L
V_f = 85 # L
P_ext = 2.5 # bar
def draw(c):
fig, ax = plt.subplots(figsize=(5.4, 3.3), constrained_layout=True)
# Shaded region, whose area is |w|
ax.fill_between([V_i, V_f], 0, P_ext, color=c.tint(c.blue, 0.75), lw=0)
ax.text((V_i + V_f) / 2, P_ext / 2, r"$|w| = P_{\mathrm{ext}}\,\Delta V$", ha="center", va="center")
# Initial and final volumes
for V, name, ha, dx in [(V_i, "$V_i$", "left", 1.5), (V_f, "$V_f$", "right", -1.5)]:
ax.plot([V, V], [0, P_ext], color=c.muted, lw=1.2, ls=(0, (4, 3)))
ax.text(V + dx, 0.12, name, ha=ha, va="bottom")
# Constant-pressure path from the initial state to the final state
ax.plot([V_i, V_f], [P_ext, P_ext], color=c.blue)
ax.plot([V_i, V_f], [P_ext, P_ext], "o", color=c.blue, ms=6.5, zorder=5)
ax.text(V_i - 2.5, P_ext, r"$P_{\mathrm{ext}}$", ha="right", va="center")
fs.arrow(ax, (V_i + 14, P_ext + 0.3), (V_f - 14, P_ext + 0.3), c.ink)
ax.text((V_i + V_f) / 2, P_ext + 0.42, "expansion", ha="center", va="bottom")
ax.set(xlabel="Volume $V$ (L)", ylabel="Pressure $P$ (bar)", xlim=(0, 100), ylim=(0, 3.5))
return fig
fs.show(draw, alt="Pressure against volume. A horizontal line at an external pressure of 2.5 bar runs from the initial "
"volume of 20 L to the final volume of 85 L, with an arrow that marks the direction of the "
"expansion. The rectangle under the line, between the two volumes, is shaded, and its area is the "
"magnitude of the work.")Figure 3.1.3:Expansion of a gas from to against a constant external pressure (Example 1). The magnitude of the work, , is the shaded area under the line.
Figure 3.1.2 showed how Joule connected mechanical work to heat. Here, the – diagram provides the geometric interpretation of work that we will use throughout this chapter: work equals the area under the pressure curve on a – diagram. Different paths between the same initial and final volumes can enclose different areas, which is precisely why work is path-dependent.
Example 2. Expanding a Soap Bubble¶
Calculate the work necessary to expand a soap bubble (two surfaces) from a radius of to . Treat the film as pure water, with surface tension (, the value for a water–air interface at room temperature). Soap lowers the surface tension of water, so the work for a real soap film is smaller.
Source
from matplotlib.patches import Circle
def draw_bubble(c):
fig, ax = plt.subplots(figsize=(5.8, 3.3), constrained_layout=True)
r_outer, r_inner = 2.0, 1.8 # the film between the two surfaces, not to scale
# Soap film between the outer surface and the inner surface
ax.add_patch(Circle((0, 0), r_outer, fc=c.fill, ec=c.blue, lw=fs.LINE))
ax.add_patch(Circle((0, 0), r_inner, fc=c.ground, ec=c.vermilion, lw=fs.LINE))
# Radius
angle = np.radians(35)
fs.arrow(ax, (0, 0), (r_inner * np.cos(angle), r_inner * np.sin(angle)), c.ink)
ax.text(0.95 * np.cos(angle) - 0.1, 0.95 * np.sin(angle) + 0.1, "$r$", ha="center", va="bottom")
ax.text(0, -0.62, "air inside", ha="center", va="center", color=c.muted)
ax.text(0, -2.45, "air outside", ha="center", va="center", color=c.muted)
# Labels of the two surfaces and of the film, with leaders
for y, radius, label, color in [(1.15, r_outer, r"outer surface, area $4\pi r^2$", c.blue),
(0.35, r_inner, r"inner surface, area $4\pi r^2$", c.vermilion)]:
x = np.sqrt(radius**2 - y**2)
ax.plot([x, 2.55], [y, y], color=color, lw=1.0)
ax.text(2.65, y, label, color=color, va="center")
ax.plot([(r_outer + r_inner) / 2 * np.cos(np.radians(-14)), 2.55], [-0.46, -0.46], color=c.muted, lw=1.0)
ax.text(2.65, -0.46, "soap film", color=c.muted, va="center")
ax.text(2.65, -1.3, r"total area $A = 2 \times 4\pi r^2 = 8\pi r^2$", va="center")
ax.set(xlim=(-2.2, 6.0), ylim=(-2.7, 2.2), aspect="equal")
ax.axis("off")
return fig
fs.show(draw_bubble, alt="Cross-section of a soap bubble, drawn as two concentric circles with the soap film between "
"them and air inside and outside. An arrow from the center marks the radius r. The outer "
"surface and the inner surface each have the area 4 pi r squared, so the total area of the "
"bubble is 8 pi r squared.")Figure 3.1.4:Cross-section of a soap bubble showing the inner and outer surfaces. Because a bubble is a thin film enclosing air, its total surface area is , and the differential area change upon inflation is . The thickness of the film is exaggerated.
Solution
Convert Units
Identify the Surface Area Change
For a single spherical surface, , so .
A bubble has two surfaces (inner and outer), so its total area is . Hence,
Write the Work Expression
From Table 3.1.1, . Here, the surroundings do work on the bubble film to increase its area:Perform the Integral
Substituting for the bubble:Thus,
Calculate Numerically
Evaluating step by step:
Interpretation
The positive sign means the surroundings do work on the system (the bubble film) to increase its surface area. This is consistent with everyday experience: you must blow air (do work) to inflate a soap bubble.
The magnitude is very small (millijoules) because the surface tension of water is modest () and the area change, while geometrically large (), is small in SI units.
Example 3. Stretching a Hookean Fiber¶
Calculate the work required to stretch a fiber obeying Hooke’s law, with , by .
Solution
Convert Units
where is the final extension.
Write the Work Expression
Hooke’s law gives the tension at the extension as . From Table 3.1.1, the infinitesimal work is:Integrate
If we stretch from to :Substitute Numbers
Interpretation
This is the energy required (work done on the system) to stretch the fiber by .
The positive sign indicates the system absorbs energy (an external force pulls on the fiber).
Note that unlike constant-pressure expansion, the Hookean force varies with displacement, producing the factor of .
Worked Example¶
Free Expansion of an Ideal Gas¶
A rigid, insulated container is divided in half by a membrane. One side contains moles of an ideal gas at temperature ; the other side is evacuated. The membrane is punctured. Determine , , and .
Work
The gas expands into vacuum, so :
Heat
The container is insulated (adiabatic walls), so .
Internal energy change
From the First Law:
Result. In free expansion, , , and . For an ideal gas (where depends only on ; see Section 2.5), this means the temperature does not change either. Free expansion is the extreme case of an irreversible process (Section 3.2): the gas does no work and exchanges no heat, yet it undergoes a dramatic change of state (its volume doubles).
Concept Checks¶
Why are and called path functions while is a state function?
In which sign convention does expansion work appear as positive? How would the First Law be written then?
Why does work depend on the external pressure for irreversible expansions?
What is the physical meaning of the chemical work term ?
Two processes connect the same initial and final states. Process A involves more work than Process B. Which process involves more heat? (Assume only work.)
Key Takeaways¶
The First Law () enforces energy conservation by bookkeeping heat and work.
Heat and work are path-dependent (, are inexact differentials); internal energy is a state function ( is an exact differential).
Many work modes share a generalized force–displacement structure, including work .
The magnitude of work equals the area under the pressure curve on a – diagram. Different paths between the same states enclose different areas.
Careful sign conventions prevent systematic mistakes in energy balances.
- Joule, J. P. (1850). On the Mechanical Equivalent of Heat. Philosophical Transactions of the Royal Society of London, 140, 61–82. 10.1098/rstl.1850.0004