The first law of thermodynamics
Engineering · Second-year university engineering · about 10 min
Heat and work are two ways energy crosses the boundary of a system. The first law makes sure energy is accounted for rather than created or lost. In a closed-system problem, it connects the energy transferred during a process to the change in energy stored within the system.
The key idea
For a stationary closed system with negligible kinetic and potential energy changes,
Here is the change in internal energy, is heat transferred into the system, and is work done by the system.

Choose the system boundary
A closed system contains a fixed amount of matter: energy can cross its boundary, but mass does not. A gas confined under a moving piston is a useful example. Select the gas as the system and draw a boundary around it. Heat supplied by a heater is positive ; heat rejected by the gas is negative. Expansion work done on the surroundings is positive ; compression work done on the gas is negative. The sign convention must be stated before using the energy equation, because some courses use the opposite sign for work.
Boundary work for a piston
When a piston moves quasistatically against pressure , the boundary work is . For a constant opposing pressure, the corresponding work is , provided the boundary movement is mechanically balanced as assumed. Expansion has , so this work is positive. Compression has , so it is negative. A convenient conversion is . If the pressure varies, do not multiply a single pressure by the volume change unless that pressure is an appropriate average.
More general energy accounting
If speed or elevation changes significantly, use rather than the simplified result. Internal energy is a property of state, while heat and work describe transfers along a particular process. As a result, for a complete cycle the system returns to its starting internal energy, and , even though net heat and work transfers may both be nonzero. Before substituting numbers, list the transfers with their signs and check that all terms use the same units.
Worked example: Heating gas beneath a moving piston
A gas in a closed piston-cylinder device expands against a constant external pressure of . Its volume rises from to while of heat enters. Ignore changes in kinetic and potential energy. Find the boundary work done by the gas and its change in internal energy.

Show the solution
1. Mark heat and work signs. Heat enters, so . The gas expands, so work done by the gas is positive.
2. Find the change in volume.
3. Calculate boundary work.
4. Apply the first law.
Answer: and . The gas stores more internal energy even after doing expansion work.
Common mistakes
Counting heat leaving as positive in the chosen convention.
Mark heat entering the system positive and heat leaving negative.
Giving expansion work a negative sign when using .
With work by the system positive, expansion work is positive and is subtracted in the balance.
Assuming heat transfer equals internal-energy change.
Include work and any important kinetic or potential energy changes.
Using constant-pressure work when pressure varies significantly.
Use or the correct process relationship.
Check your understanding
1. A stationary closed system receives and has . What is ?
2. An insulated, stationary closed system does of work on its surroundings. What is its internal-energy change?
3. What is the internal-energy change of a closed system after it completes a full thermodynamic cycle?
Still not sure? Talk it through.
Waypoint Mentor's tutor explains this out loud, works through your own problems on a whiteboard, and checks you've got it. Free to start.