PHYS-261 · Lesson 3 of 12 · 23 min
Heat, work and the first law of thermodynamics
Energy can enter or leave a system in two fundamentally different ways. It can be transferred by work, as when a piston compresses a gas or a paddle stirs a liquid, or by heat, as when a hot stove warms a pot. The first law of thermodynamics says that whatever the mix of the two, energy is conserved. This lesson makes that statement precise, introduces internal energy as a function of state, shows how to calculate the work done in the processes that matter most for gases, and derives the relation \(PV^\gamma = \text{constant}\) for adiabatic processes, which will reappear in the speed of sound, in engines and in the atmosphere.
Joule and the mechanical equivalent of heat
Until the 1840s heat was widely regarded as a conserved fluid, caloric, and was measured in calories: one calorie raised the temperature of a gram of water by one degree. James Prescott Joule, a brewer's son from Salford, carried out a series of experiments between 1843 and 1850 in which falling weights turned a paddle wheel inside an insulated vessel of water. The water warmed, and the rise in temperature was proportional to the work done by the falling weights, whatever the arrangement. Joule's best value corresponds to about 4.16 J per calorie; the modern conversion is 4.184 J per thermochemical calorie. Since the same temperature rise could be produced either by heating or by doing work, heat could not be a separately conserved substance. Both are transfers of a single conserved quantity, energy.
Internal energy and the first law
Every system has an internal energy \(U\): the total kinetic and potential energy of its molecules, measured in a frame in which the system as a whole is at rest. For an ideal monatomic gas it is just the translational kinetic energy, \(U = \frac{3}{2}nRT\); for real substances it also includes rotation, vibration and the potential energy of intermolecular forces. The crucial property of \(U\) is that it is a function of state: it depends only on the present equilibrium state of the system, for example on its temperature and volume, not on the history by which that state was reached. The first law of thermodynamics is
where \(Q\) is the heat added to the system and \(W\) is the work done by the system on its surroundings. Sign conventions vary between textbooks: chemists and many engineers write \(\Delta U = Q + W\) with \(W\) the work done on the system. We will always state which convention we use, and in this course \(W\) is the work done by the system. For a small change we write \(dU = \delta Q - \delta W\). The symbol \(\delta\) is a reminder that \(Q\) and \(W\) are not functions of state; they are amounts of energy transferred during a process and depend on the path. There is no such thing as the heat contained in a body, only the heat that flows during a change.
Work done by a gas
Consider a gas in a cylinder with a movable piston of area \(A\). If the gas pushes the piston out by \(dx\) against an external force, and the process is slow enough that the gas stays close to equilibrium with a well-defined pressure \(P\), the work done by the gas is \(\delta W = PA\,dx = P\,dV\). For a finite change,
which is the area under the path on a pressure–volume diagram. Processes carried out slowly through a sequence of equilibrium states are called quasistatic; only for them is the path a curve on the PV diagram. A process that can be reversed by an infinitesimal change in conditions, leaving no trace in the surroundings, is called reversible; reversible processes are quasistatic and also free of friction and of heat flow across finite temperature differences. Real processes are irreversible, but many are close enough to reversible that the idealization is useful.
Four special processes are the building blocks of most calculations. In an isochoric process the volume is fixed, so \(W = 0\) and \(\Delta U = Q\): all the heat goes into internal energy. In an isobaric process the pressure is fixed and \(W = P\,\Delta V\). In an isothermal process the temperature is fixed; for an ideal gas \(U\) depends only on \(T\), so \(\Delta U = 0\) and \(Q = W\), with
In an adiabatic process no heat is exchanged, \(Q = 0\), so \(\Delta U = -W\): a gas that expands adiabatically does work at the expense of its internal energy and cools, and a gas compressed adiabatically warms. The heat-free compression in a diesel engine raises the air temperature enough to ignite the fuel without a spark, and air descending a mountainside warms by compression, which is why chinook winds east of the Rockies can raise temperatures by 20 °C in an hour.
Heat capacities of an ideal gas
The heat capacity \(C\) of a system is the heat needed per kelvin of temperature rise, \(C = \delta Q/dT\). Because \(\delta Q\) depends on the path, so does \(C\), and two heat capacities are especially important. At constant volume no work is done, so \(C_V = (\partial U/\partial T)_V\). At constant pressure some of the heat goes into the work of expansion, and \(C_P = (\partial H/\partial T)_P\), where \(H = U + PV\) is the enthalpy, a function of state that is convenient for processes at constant pressure. For an ideal gas, \(H = U + nRT\), so
a result first obtained by Julius Robert Mayer in 1842 and used by him to estimate the mechanical equivalent of heat. For one mole of a monatomic gas, \(C_V = \frac{3}{2}R\) and \(C_P = \frac{5}{2}R\); for a diatomic gas near room temperature, where the molecules also rotate, \(C_V = \frac{5}{2}R\) and \(C_P = \frac{7}{2}R\). The ratio \(\gamma = C_P/C_V\) is \(\frac{5}{3}\) for monatomic gases and \(\frac{7}{5} = 1.4\) for air. Lesson 5 explains why these values hold and where they fail.
The adiabatic law
For a quasistatic adiabatic process in an ideal gas, the first law gives \(dU = -P\,dV\), and \(dU = nC_{V,m}\,dT\), where \(C_{V,m}\) is the molar heat capacity. Differentiating \(PV = nRT\) gives \(P\,dV + V\,dP = nR\,dT\). Eliminating \(dT\),
Dividing by \(C_{V,m}PV\) and using \(C_{P,m} = C_{V,m} + R\) gives \(dP/P = -\gamma\,dV/V\), which integrates to
On a PV diagram adiabats are steeper than isotherms, because as the gas is compressed adiabatically its temperature rises, adding to the pressure. The work done by the gas along an adiabat is \(W = (P_1V_1 - P_2V_2)/(\gamma - 1)\), which equals \(-\Delta U = nC_{V,m}(T_1 - T_2)\). Pierre-Simon Laplace realized in 1816 that sound waves compress air adiabatically rather than isothermally, because the compressions are too fast for heat to flow; using \(\gamma P\) rather than \(P\) as the effective stiffness corrected Newton's value for the speed of sound by about 18%.
A cycle in numbers
A cycle is a process that returns a system to its initial state. Because \(U\) is a function of state, \(\Delta U = 0\) around any cycle, so the net heat absorbed equals the net work done. The program below follows one mole of a diatomic ideal gas around a rectangle on the PV diagram, between 200 kPa and 100 kPa and between 10 L and 25 L. For each leg it computes \(\Delta U = nC_{V,m}\Delta T\), the work, and the heat from the first law. It then checks the adiabatic work formula against a direct numerical integral of \(P\,dV\).
import math
R = 8.314462618 # J/(mol K)
n, Cv = 1.0, 2.5 * R # one mole of a diatomic ideal gas near room temperature
Cp = Cv + R; gamma = Cp / Cv
def T(P, V): return P * V / (n * R)
# A rectangular cycle on the PV diagram: 200 kPa / 100 kPa, 10 L / 25 L
A = (200e3, 0.010); B = (200e3, 0.025); C = (100e3, 0.025); D = (100e3, 0.010)
legs = [("A->B isobaric expansion", A, B), ("B->C isochoric cooling", B, C),
("C->D isobaric compression", C, D), ("D->A isochoric heating", D, A)]
print("leg dU (J) W by gas (J) Q in (J)")
tot = [0, 0, 0]; Qin = 0.0
for name, (P1, V1), (P2, V2) in legs:
dU = n * Cv * (T(P2, V2) - T(P1, V1))
W = P1 * (V2 - V1) if P1 == P2 else 0.0
Q = dU + W # first law: Q = dU + W
tot = [tot[0] + dU, tot[1] + W, tot[2] + Q]
Qin += max(Q, 0.0)
print(f"{name:26s} {dU:10.1f} {W:13.1f} {Q:12.1f}")
print(f"{'whole cycle':26s} {abs(tot[0]):10.1f} {tot[1]:13.1f} {tot[2]:12.1f}")
print(f"efficiency = net work / heat absorbed = {tot[1] / Qin:.3f}")
# Work along an adiabat: compare numerical integral of P dV with the formula
P1, V1, V2 = 100e3, 0.025, 0.010
K = P1 * V1**gamma
N = 10000
h = (V2 - V1) / N
W_num = sum(K / (V1 + (k + 0.5) * h)**gamma for k in range(N)) * h
P2 = K / V2**gamma
W_formula = (P2 * V2 - P1 * V1) / (1 - gamma)
print(f"\nadiabatic compression 25 L -> 10 L from 100 kPa, {T(P1, V1):.1f} K:")
print(f" final pressure {P2 / 1e3:.1f} kPa, final temperature {T(P2, V2):.1f} K")
print(f" work by gas: midpoint integral {W_num:.2f} J, formula {W_formula:.2f} J")
print(f" increase in internal energy {n * Cv * (T(P2, V2) - T(P1, V1)):.2f} J")leg dU (J) W by gas (J) Q in (J) A->B isobaric expansion 7500.0 3000.0 10500.0 B->C isochoric cooling -6250.0 0.0 -6250.0 C->D isobaric compression -3750.0 -1500.0 -5250.0 D->A isochoric heating 2500.0 0.0 2500.0 whole cycle 0.0 1500.0 1500.0 efficiency = net work / heat absorbed = 0.115 adiabatic compression 25 L -> 10 L from 100 kPa, 300.7 K: final pressure 360.7 kPa, final temperature 433.8 K work by gas: midpoint integral -2766.87 J, formula -2766.87 J increase in internal energy 2766.87 J
The changes in internal energy add to zero around the cycle, while the work and the heat do not: the gas does 3000 J of work on the high-pressure stroke and has 1500 J done on it on the low-pressure stroke, so it delivers a net 1500 J, equal to the enclosed area \(\Delta P \Delta V = 100\ \text{kPa} \times 15\ \text{L}\). The gas absorbs 13 000 J of heat on legs AB and DA and rejects 11 500 J on legs BC and CD, so only 11.5% of the heat absorbed becomes work. That is a poor engine, and lesson 7 will show why no engine operating between the extreme temperatures of this cycle, about 600 K at B and 120 K at D, could exceed 80%. The adiabatic compression from 25 L to 10 L raises the temperature from 301 K to 434 K, and the numerical integral of \(P\,dV\) agrees with the formula to every digit printed.
Enthalpy and flowing systems
Enthalpy earns its place whenever processes happen at constant pressure, which includes most of chemistry and everyday life. The heat absorbed by a system at constant pressure equals its change in enthalpy, \(Q_P = \Delta H\), because the work \(P\,\Delta V\) is automatically accounted for. Latent heats and heats of reaction are tabulated as enthalpy changes. Enthalpy is also the right quantity for steady flow through devices such as turbines, compressors and throttling valves: the energy carried by a stream of fluid includes the work \(PV\) needed to push it into the device. In the Joule–Thomson process a gas is forced through a porous plug or valve from high to low pressure; no heat or shaft work is exchanged, so the enthalpy per unit mass is unchanged. For an ideal gas this means no temperature change, but real gases usually cool, which is how air is liquefied. Lesson 9 computes the effect for a van der Waals gas. Detailed engineering analysis of turbines and nozzles belongs to the engineering thermodynamics courses; here our interest is in the physics.
Worked problem
Isothermal versus adiabatic expansion
One mole of helium at 300 K expands from 10 L to 20 L. Find the work done by the gas and its final temperature if the expansion is (a) isothermal, (b) adiabatic.
Show solution
- (a) Isothermal: \(W = nRT\ln 2 = 8.314 \times 300 \times 0.6931 = 1729\) J. The temperature stays at 300 K, and \(Q = W = 1729\) J flows in.
- (b) Adiabatic, with \(\gamma = 5/3\): \(T_2 = T_1 (V_1/V_2)^{\gamma - 1} = 300 \times 0.5^{2/3} = 300 \times 0.630 = 189\) K.
- The work equals the loss of internal energy: \(W = \frac32 R (T_1 - T_2) = 1.5 \times 8.314 \times 111 = 1386\) J.
- The adiabatic work is smaller because the pressure falls faster as the gas cools.
Answer: (a) 1729 J at constant 300 K; (b) 1386 J, with the gas cooling to 189 K.
Common mistakes
MistakeSpeaking of the heat contained in a body.
InsteadHeat is energy in transit; a body contains internal energy, which can change by heat or by work.
MistakeMixing sign conventions for work.
InsteadDecide whether \(W\) is work by or on the system and keep the first law consistent with that choice.
MistakeUsing \(W = nRT\ln(V_2/V_1)\) for a process that is not isothermal.
InsteadThat formula holds only at constant temperature; for other paths integrate \(P\,dV\) along the actual path.
MistakeConfusing adiabatic with isothermal.
InsteadAdiabatic means no heat flow; the temperature generally changes. Isothermal means constant temperature; heat generally flows.
MistakeAssuming \(C_P = C_V\) for gases.
InsteadAt constant pressure the gas also does work, so \(C_P = C_V + nR\) for an ideal gas.
Summary and key terms
- The first law is \(\Delta U = Q - W\), with \(U\) a function of state and \(Q\), \(W\) path-dependent transfers.
- Quasistatic work is \(W = \int P\,dV\), the area under the path on a PV diagram.
- For an ideal gas: isothermal \(W = nRT\ln(V_2/V_1)\); isochoric \(W = 0\); isobaric \(W = P\Delta V\).
- \(C_P = C_V + nR\) for an ideal gas, and \(\gamma = C_P/C_V\) is 5/3 for monatomic gases and 7/5 for air.
- In a quasistatic adiabatic process \(PV^\gamma\) is constant and \(W = (P_1V_1 - P_2V_2)/(\gamma - 1)\).
- Around any cycle \(\Delta U = 0\), so net heat absorbed equals net work done.
- internal energy
- The total microscopic kinetic and potential energy of a system, a function of state.
- function of state
- A quantity that depends only on the present equilibrium state, not on history.
- quasistatic process
- A process slow enough that the system passes through a sequence of equilibrium states.
- adiabatic process
- A process in which no heat is exchanged with the surroundings.
- enthalpy
- H = U + PV; its change equals the heat absorbed at constant pressure.
- heat capacity
- The heat required per unit temperature rise, which depends on the path.
Practice problems
Work each problem on paper first, then reveal the answer to check.
A gas absorbs 500 J of heat and does 200 J of work. What is the change in its internal energy?
Show answer
\(\Delta U = 500 - 200 = 300\) J.
Two moles of an ideal gas are compressed isothermally at 280 K from 40 L to 10 L. How much heat flows, and in which direction?
Show answer
\(W = 2 \times 8.314 \times 280 \times \ln(1/4) = -6455\) J, so \(Q = W = -6455\) J: 6.5 kJ flows out of the gas.
Air at 100 kPa and 290 K is compressed adiabatically to one-sixteenth of its volume, as in a diesel engine. Find the final temperature and pressure.
Show answer
\(T_2 = 290 \times 16^{0.4} = 290 \times 3.03 = 879\) K; \(P_2 = 100 \times 16^{1.4} = 100 \times 48.5 = 4850\) kPa.
How much heat is needed to warm 1 mol of nitrogen from 20 °C to 100 °C at constant pressure?
Show answer
\(Q = \frac72 R \times 80 = 29.10 \times 80 = 2328\) J.
Show that \(TV^{\gamma - 1}\) is constant along an adiabat, starting from \(PV^\gamma\) constant.
Show answer
Substitute \(P = nRT/V\): \(nRT V^{\gamma - 1}\) is constant, so \(TV^{\gamma-1}\) is constant.
In a cycle a gas absorbs 900 J of heat in total and rejects 650 J. How much net work does it do?
Show answer
Since \(\Delta U = 0\), \(W = 900 - 650 = 250\) J.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.