Thermodynamics · Chapter 2

Energy and the First Law

Rub your hands together and they warm up. Pump up a bike tire and the pump gets warm. You can heat a gas without any flame at all, just by squeezing it. Heat and work are two ways to move energy into or out of something, and the first law of thermodynamics keeps the books: energy is never made and never destroyed. Here you’ll heat, cool, squeeze and stretch a cylinder of gas, trace its path on a pressure–volume diagram, and watch the ledger balance to the last joule.

Processes

Under the cylinder
The piston
0 weights

Live numbers

Pressure P
—
Volume V
—
Temperature T
—
Internal energy U
—
Heat in Q
—
Work by gas W
—
ΔU
—
Q − W − ΔU
—

0.100 mol of helium, an ideal monatomic gas: U = (3/2) n R T. The air outside pushes with 101.3 kPa; each weight adds 19.6 kPa on the 100 cm² piston.

Missions

    What you’re seeing

    The cylinder. A tenth of a mole of helium (about 6 × 1022 atoms) sits under a light piston 10 cm across. The dots stand in for the atoms. They are colored by speed, from blue for slow to red and gold for fast, and they all speed up as the gas gets hotter. Under the cylinder you can put a flame, ice, a water bath at 300 K, or nothing but insulation. The piston can be locked, loaded with weights, or moved by your hand.

    The P–V diagram. Every state of the gas is a point: volume across, pressure up. As the gas changes, the point leaves a trail, red where heat flows in, blue where heat flows out, and green where no heat flows at all. The dashed gold curve is the isotherm through the current state: every point on it has the same temperature. The green shading under the path since your last change is the work the gas has done.

    The energy bars. Q is the heat that has flowed into the gas, W the work the gas has done on the piston, and ΔU the change in its internal energy, all counted from the last time you zeroed the meters. Whatever you do, Q − W equals ΔU.

    Loops. Bring the path back across itself and the loop fills in with gold. The area inside is the net work done in one trip around: positive if you went clockwise, which is what an engine does.

    The first law

    A gas holds energy in the motion of its molecules. That total is its internal energy, U. There are only two ways to change it from outside: let heat flow in or out because of a temperature difference, or do work by pushing on it. The first law of thermodynamics says the books always balance:

    ΔU = Q − Wchange in internal energy (J) = heat added to the system (J) − work done by the system (J)

    Heat in raises U. Work the gas does on its surroundings, pushing a piston out, lowers it. When you push the piston in, the gas does negative work, so −W is positive and U goes up. For an ideal gas made of single atoms, like helium, the internal energy depends only on temperature:

    U = (3/2) n R T     P V = n R T     n in moles, R = 8.314 J/(mol·K), T in kelvins, P in pascals, V in cubic meters

    So for this gas, “hotter” and “more internal energy” are the same thing. For molecules with more parts, such as the nitrogen in air, some energy also goes into spinning, and the 3/2 becomes 5/2.

    Work is the area under the curve

    When a gas at pressure P pushes a piston of area A out by a distance d, the force is P A and the work is P A d. But A d is the change in volume, so

    W = P ΔV  (constant pressure)     W = ∫ P dV  (in general: the area under the path on the P–V diagram)

    The work depends on the path, not just on where you start and end. So does the heat. Only their difference, ΔU, is fixed by the two end states. That’s why a loop can turn heat into work: go around once, come back to the same state, and ΔU = 0, so the net heat in equals the net work out, which is the area inside the loop.

    Four special processes

    ProcessWhat’s held fixedWork WHeat QΔU
    Constant volume (isochoric)V: piston locked0(3/2) n R ΔT= Q
    Constant pressure (isobaric)P: weights ride on the pistonP ΔV = n R ΔT(5/2) n R ΔT(3/2) n R ΔT
    IsothermalT: in a big water bath, slowlyn R T ln(V₂/V₁)= W0
    Adiabaticno heat: insulated, or too fast for heat to flow−ΔU0(3/2) n R ΔT

    In an adiabatic process, P Vγ stays constant, with γ = 5/3 for helium (and 7/5 for air), so the curve is steeper than an isotherm. Squeeze a gas adiabatically and every bit of your work becomes internal energy: it gets hot. Let it expand and it pays for its work out of its own internal energy: it gets cold.

    Worked example: heating at constant pressure

    Heat the simulation’s 0.100 mol of helium with no weights on the piston (P = 101.3 kPa) from 300 K to 400 K.

    1. ΔU = (3/2) n R ΔT = 1.5 × 0.100 × 8.314 × 100 = 124.7 J.
    2. W = P ΔV = n R ΔT = 0.100 × 8.314 × 100 = 83.1 J. The volume grows from 2.46 L to 3.28 L.
    3. Q = ΔU + W = 207.9 J. Only 60% of the heat stays in the gas; 40% goes out as work lifting the piston and pushing back the air.
    Worked example: a bike pump

    Squeeze the gas fast, before heat can leak out (adiabatic), from 2.46 L at 300 K down to 0.90 L.

    1. T Vγ−1 stays fixed: T₂ = 300 K × (2.46 / 0.90)2/3 = 587 K, or 314 °C.
    2. ΔU = (3/2) n R ΔT = 1.5 × 0.100 × 8.314 × 287 = 358 J, and Q = 0.
    3. So W = −358 J: you did 358 J of work on the gas, and all of it became internal energy. That’s the Bike pump mission. A real pump’s air also leaks heat into the barrel, which is one reason the barrel gets warm.
    Worked example: isothermal expansion

    In the 300 K water bath, slowly pull the piston from 2.46 L to 4.92 L.

    1. T doesn’t change, so ΔU = 0.
    2. W = n R T ln(V₂/V₁) = 0.100 × 8.314 × 300 × ln 2 = 172.9 J.
    3. Q = W = 172.9 J: every joule of work the gas did came in from the bath as heat. In the simulation you get about 174 J if you pull at full speed, because the gas cools a little before the bath can catch up; go slowly and it closes in on 172.9 J.

    Signs: physics and chemistry

    This page, like OpenStax University Physics, counts W as work done by the gas, so ΔU = Q − W. That comes from steam engines, where work out is the point. Chemistry books usually count work done on the system, and write ΔU = q + w. It’s the same law with the opposite sign for work: w = −W. Always check which one a book uses.

    Try this: choose Adiabatic, squeeze the gas to 1 L, then let it back out to where it started. The temperature comes right back, and the path runs back down the same curve: you got all your work back. Now do it with the flame on. Then try Isothermal and compare the slopes of the two curves.
    Common mistake

    “If something got hotter, something must have heated it.” Not so. In the Bike pump mission the gas is wrapped in insulation, no heat gets in at all, and its temperature doubles. Work did it. Heat and work are two different doors into the same room, internal energy, and once energy is inside you can’t tell which door it came through. The opposite is true too: in the isothermal mission, heat flows in and the temperature doesn’t budge, because the gas spends it all on work.

    Joule’s paddle wheel

    If heat is just energy, then a fixed amount of work should always make the same amount of heat. In the 1840s, James Prescott Joule set out to measure that exchange rate. Falling weights turned paddles in an insulated tank of water. The churning water warmed up by a tiny amount, and Joule measured it with a very fine thermometer. Try it.

    Apparatus

    Drops
    0
    Work done (2 M g h)
    0 J
    Water warmed by
    0.000 °C
    Same, in calories
    0 cal
    Fall for +1 °C
    —

    Goals

      Each drop, the two weights lose potential energy 2M g h. The paddles keep them falling slowly, so almost none of it is left as motion at the bottom; it all ends up churning the water, then as random jiggling of water molecules: internal energy. So

      2 M g h = mwater cwater ΔT  ⟹  h = mwater cwater ΔT ÷ (2 M g)
      Worked example: one degree the hard way

      Two 10 kg weights, 1.0 kg of water. How far must they fall to warm it by 1 °C?

      1. Energy needed: 1.0 × 4186 × 1 = 4186 J.
      2. h = 4186 ÷ (2 × 10 × 9.81) = 21.3 m: about a seven-story building. That’s why Joule had to wind his weights up and drop them again and again, and why he needed such a sensitive thermometer.

      Joule reported in 1850 that the heat that warms a pound of water by 1 °F equals the work of 772 pound-weights falling one foot. In today’s units that is about 4.15 joules per calorie, within 1% of the modern value. The unit of energy is named after him.

      Calories, joules and food

      The calorie was defined as the heat that warms 1 gram of water by 1 °C. Today it is defined in joules: the thermochemical calorie is exactly 4.184 J. The Calorie on a food label, with a capital C, is a kilocalorie:

      1 cal = 4.184 J     1 food Calorie = 1 kcal = 4184 J     1 BTU ≈ 1055 J

        Your body can’t turn all of food’s energy into lifting; most of it ends up as heat. The first law still holds: it’s all accounted for somewhere.

        Heat is motion: Rumford and Joule

        Around 1800, many scientists pictured heat as caloric, a weightless fluid that flows out of hot things. Benjamin Thompson, Count Rumford, oversaw the military arsenal in Munich, where cannon barrels were bored out of solid metal. He noticed how hot the metal got. In an experiment he published in 1798, he set a blunt borer grinding inside a barrel sunk in a box of water, about 18.8 pounds of it. The water grew warmer and warmer, and finally boiled. He wrote:

        “At two hours twenty minutes it was at 200; and at two hours thirty minutes it actually boiled!”

        Benjamin Thompson, Count Rumford, “An Inquiry concerning the Source of the Heat which is excited by Friction,” Philosophical Transactions of the Royal Society, 1798; as quoted in Popular Science Monthly, December 1877 (the 200 is degrees Fahrenheit)

        Friction seemed able to make heat without limit, for as long as the boring went on. A fluid stored in the metal should run out. Rumford concluded that heat could not be a substance at all; the only thing he could picture being made and passed along that way was motion.

        The idea took decades to win. In the 1840s Joule measured the exchange rate between work and heat, again and again, with paddle wheels, electric currents and compressed air. At a meeting in Oxford in 1847, the young William Thomson, later Lord Kelvin, heard him and was intrigued but doubtful; within a few years Thomson was building the new science of thermodynamics on Joule’s results. In 1847 Hermann von Helmholtz published a general statement of the conservation of energy. Heat had become one more form of energy on the move.

        Where the energy goes in a car

        A gasoline car is a heat engine on wheels. Burning fuel releases energy, the hot gas pushes pistons, and the pistons turn the wheels. But most of the energy never reaches the wheels. The U.S. Department of Energy estimates that in combined city and highway driving only about 16 to 25 percent of the fuel’s energy gets to the wheels, and between 12 and 30 percent depending on the kind of driving. Watch where each packet of energy ends up. Tap a stream to read about it.

        Where it goesShare of the fuel’s energy
        Engine losses: heat out the exhaust and radiator, pumping and friction68–72%
        Parasitic losses (accessories)4–6%
        Drivetrain losses5–6%
        Idling3%
        Auxiliary engine losses0–2%
        Power to the wheels16–25%

        Combined city and highway driving, from the U.S. Department of Energy’s Fact of the Week #1044 (2018), using fueleconomy.gov. The animation uses one set of numbers inside these ranges: 69, 5, 5, 3, 1 and 17 percent.

        And the 17% that reaches the wheels? It pushes air out of the way, flexes the tires and, every time you brake, heats the brakes. On a trip that starts and ends parked on level ground, every joule from the fuel ends up as heat in the air and the road. That’s the first law: the energy is all still there, just spread out where it can’t do anything useful. Why an engine can’t turn all its heat into work is a second-law story, in Chapters 3 and 4. For how a real engine works, see The Engine in our Cars course; electric cars do much better: the Department of Energy puts them at about 87 to 91 percent efficient, counting the energy they win back while braking.

        Why perpetual-motion machines can’t work

        For centuries inventors drew wheels with rolling balls, magnets and self-filling water tanks that would turn forever and do work for free. The first law says why none of them can: a machine that runs in a cycle comes back to the same state each time, so ΔU = 0, and the work it puts out over a cycle must equal the energy put in. Work from nothing would need energy from nothing.

        A cleverer machine might take heat from the air or the sea, which hold enormous amounts of internal energy, and turn all of it into work. That doesn’t break the first law, but it breaks the second, as Chapter 3 explains. Real machines also lose some energy to friction along the way, which turns into heat. So no machine gives back more work than the energy you feed it, and real ones give back less.

        Where you see it

        Bike pumps and tires

        Pumping does work on the air, raising its internal energy and temperature, as in the Bike pump mission.

        Diesel engines

        A diesel squeezes air so hard and so fast that it gets hot enough to light the fuel sprayed in, with no spark plug. OpenStax works out a gasoline engine’s compression: from 20 °C to about 330 °C.

        Clouds

        Rising air expands as the pressure around it drops, does work, and cools, with little time to take in heat. That’s the Cool by expanding mission, and it’s how many clouds form.

        Engines

        Every engine runs the gas around a loop on the P–V diagram, clockwise. The area of the loop is the work per cycle. See The Engine and Chapter 4.

        Heat pumps

        Run the loop counterclockwise and you spend work to move heat from cold to hot. That’s a refrigerator or a heat pump; see the HVAC course.

        Your body

        Food energy becomes work and heat. Even at rest you give off heat, which is why a full room warms up.

        How the simulation works

        The gas. The numbers come from exact ideal-gas thermodynamics for 0.100 mol of helium: P V = n R T and U = (3/2)n R T, with R = 8.314462618 J/(mol·K), which has been exact since 2019. Every change is quasi-static: the gas is always in balance, with one pressure throughout. Each 2-millisecond step has two exact parts. First, heat flows at fixed volume: the gas relaxes toward the temperature of whatever touches it (a 1800 K flame, ice at 273.15 K, or a 300 K bath), following Newton’s law of cooling. Second, the piston moves along an adiabat, T V2/3 = constant, and the work is exactly the drop in internal energy along that curve. So ΔU = Q − W holds in every step.

        The piston. With weights, the piston moves to wherever the gas pressure balances the air plus the weights. Weights go on and off gently, like pouring sand, so the gas stays in balance. Your hand moves it at up to 2.5 liters per second. Stops hold the volume between 0.4 and 5 liters.

        The dots. They are for the look: 90 dots bouncing in the cylinder. Each frame their speeds are scaled so their average kinetic energy follows the gas’s real temperature, so they speed up and slow down exactly as the numbers say.

        What’s simplified. The cylinder and piston take no heat themselves, the piston has no friction, and a real flame or bath would have more complicated heat flow. A real gas compressed this hard would be a little less ideal.

        How we checked it. In tests, 400 random changes of heat source, piston mode, weights and volume over 12,000 frames kept Q − W − ΔU below 10−11 J. Locked heating gave W = 0 and Q = ΔU. Heating with two weights gave W within 0.02% of PΔV and W/Q = 0.4000 (theory 2/5). Adiabatic squeezing kept P V5/3 constant to 14 digits and reached 868.23 K, matching theory. Isothermal halving in the bath gave W = −177.9, −173.9 and −173.1 J at 2.5, 0.5 and 0.1 L/s, closing in on the exact −172.9 J. Around a closed loop, the net work (19.988 J) matched the area inside (19.980 J) and the net heat (19.988 J). In the page, loops are cut out exactly where the path crosses itself.

        Joule’s apparatus uses 2M g h = m c ΔT with g = 9.80665 m/s² and water’s 4186 J/(kg·K), ignoring the heat taken by the tank and paddles, which Joule measured and corrected for.

        Check yourself

        1. A gas takes in 500 J of heat and does 200 J of work pushing a piston out. What is the change in its internal energy?

          Show the answer

          ΔU = Q − W = 500 − 200 = 300 J.

        2. You squeeze a gas inside an insulated cylinder. What happens?

          Show the answer

          Q = 0 and W is negative (work is done on the gas), so ΔU = −W > 0: the gas heats up. That’s a bike pump.

        3. An ideal gas expands slowly at constant temperature and does 150 J of work. How much heat flowed in?

          Show the answer

          At constant temperature an ideal gas’s internal energy doesn’t change, so Q = W = 150 J.

        4. A gas goes once around a clockwise loop on a P–V diagram whose area is 80 J. What is the net heat into the gas?

          Show the answer

          Around a loop ΔU = 0, so Q = W = the area, 80 J. It’s ΔU that’s zero, not Q.

        5. How far must two 10 kg weights fall in Joule’s apparatus to warm 2.0 kg of water by 0.50 °C?

          Show the answer

          h = m c ΔT ÷ (2 M g) = 2.0 × 4186 × 0.50 ÷ (2 × 10 × 9.81) = 21.3 m. Twice the water, half the warming: the same as 1 °C for 1 kg.

        6. A chemistry book says a gas had w = +50 J. In this page’s physics convention, what is W?

          Show the answer

          Chemistry’s w is work done on the system, so W = −w = −50 J.

        Sources

        Saved on this device only.
        @teddyrookbook GitHub