First Law of Thermodynamics
The Mathematical Statement
The first law is expressed mathematically as dU = Q - W, where dU is the change in internal energy of the system, Q is the heat added to the system, and W is the work done by the system on its surroundings. This equation is a bookkeeping tool that tracks every joule of energy entering or leaving a system. If you add heat to a gas in a cylinder, that energy must either increase the gas internal energy (raising its temperature) or do work by pushing the piston outward, or some combination of both.
The sign convention matters: Q is positive when heat flows into the system, and W is positive when the system does work on its surroundings. Some textbooks use the convention dU = Q + W, where W represents work done on the system. Both conventions are correct as long as they are applied consistently. The important point is that energy is always accounted for, no energy appears from nowhere, and no energy vanishes into nothing.
For infinitesimal changes, the first law is written using inexact differentials for heat and work (since they are path-dependent) and an exact differential for internal energy (since it is a state function). This distinction is critical: the amount of heat or work exchanged during a process depends on the specific path taken, but the change in internal energy depends only on the initial and final states.
Internal Energy as a State Function
Internal energy (U) includes all microscopic forms of energy within a system: the translational, rotational, and vibrational kinetic energy of molecules, the potential energy from intermolecular forces, and the energy stored in chemical bonds. For an ideal gas, internal energy depends only on temperature, not on pressure or volume. For real gases and other substances, internal energy also depends on density and molecular interactions.
Because internal energy is a state function, the change in internal energy between two states is the same regardless of the path taken. You could heat a gas at constant pressure and then compress it, or compress it first and then heat it, and the net change in internal energy would be identical as long as the initial and final states are the same. This property makes the first law particularly powerful for analyzing cyclic processes, where the system returns to its initial state and the net change in internal energy is zero.
Heat and Work: Path-Dependent Quantities
Unlike internal energy, heat and work are not properties of a system. They are processes, ways that energy crosses the system boundary. A system does not "contain" heat or "contain" work. It contains internal energy, and that energy changes when heat is transferred or work is performed.
This distinction has practical consequences. If you compress a gas slowly and isothermally, the work done on the gas is different from the work done during a rapid adiabatic compression to the same final state. The path matters. This is why engineers carefully specify the type of process (isothermal, adiabatic, isobaric, isochoric) when calculating heat and work exchanges.
In a constant-volume process (isochoric), no work is done because the volume does not change, so all heat added goes directly into increasing internal energy: dU = Q. In a constant-pressure process (isobaric), the system can expand and do work, so the heat added must account for both the increase in internal energy and the work done: Q = dU + P dV. This leads naturally to the concept of enthalpy, H = U + PV, which simplifies constant-pressure calculations.
The first law is a universal energy balance: every joule of energy entering a system must either increase its internal energy or leave as work. No exceptions have ever been found.
Perpetual Motion and the First Law
The first law rules out perpetual motion machines of the first kind, devices that would produce work indefinitely without any energy input. Such machines would violate energy conservation by creating energy from nothing. Throughout history, inventors have proposed countless designs for such machines, and all have failed. The U.S. Patent Office no longer accepts patent applications for perpetual motion machines, recognizing that the first law makes them impossible.
It is worth noting that the first law alone does not prevent all impossible machines. A machine that converts heat entirely into work without any other effect would satisfy the first law (energy is conserved) but violates the second law (entropy must increase). The first and second laws together provide a complete framework for determining what processes are physically possible.
Applications of the First Law
The first law is applied constantly in engineering and science. Chemical engineers use it to calculate the energy requirements of industrial reactions. Mechanical engineers apply it to analyze the performance of engines, compressors, and turbines. Atmospheric scientists use it to model how air parcels heat and cool as they rise and sink in the atmosphere, driving weather patterns.
In biology, the first law governs metabolism. The chemical energy in food is converted to kinetic energy (movement), thermal energy (body heat), and chemical energy stored in ATP and other molecules. Every calorie consumed must be accounted for: it either does work, maintains body temperature, or is stored as chemical potential energy in body tissues.
In astrophysics, the first law helps describe the energy balance of stars, where nuclear fusion converts mass into energy (via E = mc squared), and that energy radiates outward as light and heat. Even at cosmological scales, energy conservation holds, though general relativity introduces subtleties about how energy is defined in curved spacetime.