Skip to main content
Physics LibreTexts

14.4: First Law of Thermodynamics

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives

    By the end of this section, you will be able to:

    • State the first law of thermodynamics and explain how it is applied
    • Explain how heat transfer, work done, and internal energy change are related in any thermodynamic process

    Now that we have seen how to calculate internal energy, heat, and work done for a thermodynamic system undergoing change during some process, we can see how these quantities interact to affect the amount of change that can occur. This interaction is given by the first law of thermodynamics. British scientist and novelist C. P. Snow (1905–1980) is credited with a joke about the four laws of thermodynamics. His humorous statement of the first law of thermodynamics is stated “you can’t win,” or in other words, you cannot get more energy out of a system than you put into it. We will see in this chapter how internal energy, heat, and work all play a role in the first law of thermodynamics.

    Suppose \(Q\) represents the heat exchanged between a system and the environment, and \(W\) is the work done by or on the system. The first law states that the change in internal energy of that system is given by \(Q - W\). Since added heat increases the internal energy of a system, \(Q\) is positive when it is added to the system and negative when it is removed from the system. When a gas expands, it does work and its internal energy decreases. Thus, \(W\) is positive when work is done by the system and negative when work is done on the system. This sign convention is summarized in Table \(\PageIndex{1}\). The first law of thermodynamics is stated as follows:

    First Law of Thermodynamics

    Associated with every equilibrium state of a system is its internal energy \(E_{int}\). The change in \(E_{int}\) for any transition between two equilibrium states is

    \[\Delta E_{int} = Q - W \label{1law}\]

    where \(Q\) and \(W\) represent, respectively, the heat exchanged by the system and the work done by the system.

    Table \(\PageIndex{1}\): Thermodynamic Sign Conventions for Heat and Work
    Process Convention
    Heat added to system \(Q > 0\)
    Heat removed from system \(Q < 0\)
    Work done by system \(W > 0\)
    Work done on system \(W < 0\)

    The first law (Equation \ref{1law}) is a statement of energy conservation that tells us that a system can exchange energy with its surroundings by the transmission of heat and by the performance of work. The net energy exchanged is then equal to the change in the total mechanical energy of the molecules of the system (i.e., the system’s internal energy). Thus, if a system is isolated, its internal energy must remain constant.

    The figure is a graph of p on the vertical as a function of V on the horizontal axis. Six different curves are shown, all connecting a point A on the graph to a point B. The pressure at A is larger than at B, and the volume at A is lower than at B. Curve 1 goes up and curves around to reach B from above. Curve 2 is  similar to 1 but not as curved. Curve 3 is a straight line from A to B. Curve 4 wiggles a bit below the straight line of curve 3. Curve 5 bends down and around to B, reaching it from below. Curve 6 is similar to curve 5 but goes farther out.
    Figure \(\PageIndex{1}\): Different thermodynamic paths taken by a system in going from state A to state B. For all transitions, the change in the internal energy of the system \(\Delta E_{int} = Q - W\) is the same.

    Although \(Q\) and \(W\) both depend on the thermodynamic path taken between two equilibrium states, their difference \(Q - W\) does not. Figure \(\PageIndex{1}\) shows the pV diagram of a system that is making the transition from \(A\) to \(B\) repeatedly along different thermodynamic paths. Along path 1, the system absorbs heat \(Q_1\) and does work \(W_1\) along path 2, it absorbs heat \(Q_2\) and does work \(W_2\) and so on. The values of \(Q_i\) and \(W_i\) may vary from path to path, but we have

    \[\underbrace{Q_1 - W_1}_{\text{path 1}} = \underbrace{Q_2 - W_2}_{\text{path 2}} = \dots = \underbrace{Q_i - W_i}_{\text{path i}} \]


    \[\underbrace{\Delta E_{\text{int 1}}}_{\text{path 1}} = \underbrace{\Delta E_{\text{int 2}}}_{\text{path 2}} = \dots = \underbrace{\Delta E_{\text{int i}}}_{\text{path i}} \]

    That is, the change in the internal energy of the system between \(A\) and \(B\) is path independent. In the chapter on potential energy and the conservation of energy, we encountered another path-independent quantity: the change in potential energy between two arbitrary points in space. This change represents the negative of the work done by a conservative force between the two points. The potential energy is a function of spatial coordinates, whereas the internal energy is a function of thermodynamic variables. For example, we might write \(E_{int}(T,p) \) for the internal energy. Functions such as internal energy and potential energy are known as state functions because their values depend solely on the state of the system.

    Often the first law is used in its differential form, which is

    \[dE_{int} = dQ - dW.\]

    Here \(dE_{int}\) is an infinitesimal change in internal energy when an infinitesimal amount of heat \(dQ\) is exchanged with the system and an infinitesimal amount of work dW is done by (positive in sign) or on (negative in sign) the system.

    Changes of State and the First Law

    During a thermodynamic process, a system moves from state A to state B, it is supplied with 400 J of heat and does 100 J of work.

    1. For this transition, what is the system’s change in internal energy?
    2. If the system then moves from state B back to state A, what is its change in internal energy?
    3. If in moving from A to B along a different path, \(W'_{AB} = 400 \, J\)

    of work is done on the system, how much heat does it absorb?


    The first law of thermodynamics relates the internal energy change, work done by the system, and the heat transferred to the system in a simple equation. The internal energy is a function of state and is therefore fixed at any given point regardless of how the system reaches the state.


    1. From the first law, the change in the system’s internal energy is \[\begin{align} \Delta E_{intAB} &= Q_{AB} - W_{AB} \nonumber \\[4pt] &= 400 \, J - 100 \, J = 300 \, J. \nonumber \end{align} \nonumber\]
    2. Consider a closed path that passes through the states A and B. Internal energy is a state function, so \(\Delta E_{int}\) is zero for a closed path. Thus \[\Delta E_{int} = \Delta E_{intAB} + \Delta E_{intBA} = 0,\nonumber \] and \[\Delta E_{intAB} = - \Delta E_{intBA}.\] This yields \[\Delta E_{intBA} = -300 \, J. \nonumber\]
    3. The change in internal energy is the same for any path, so \[\begin{align} \Delta E_{intAB} &= \Delta E'_{intAB} \nonumber \\[4pt] &= Q'_{AB} - W'_{AB} \nonumber \\[4pt] 300 \, J &= Q'_{AB} - (-400 \, J), \nonumber \end{align} \nonumber\] and the heat exchanged is \[Q'_{AB} = -100 \, J. \nonumber\] The negative sign indicates that the system loses heat in this transition.


    When a closed cycle is considered for the first law of thermodynamics, the change in internal energy around the whole path is equal to zero. If friction were to play a role in this example, less work would result from this heat added. Example \(\PageIndex{1B}\) takes into consideration what happens if friction plays a role.

    Notice that in Example \(\PageIndex{1A}\), we did not assume that the transitions were quasi-static. This is because the first law is not subject to such a restriction. It describes transitions between equilibrium states but is not concerned with the intermediate states. The system does not have to pass through only equilibrium states. For example, if a gas in a steel container at a well-defined temperature and pressure is made to explode by means of a spark, some of the gas may condense, different gas molecules may combine to form new compounds, and there may be all sorts of turbulence in the container—but eventually, the system will settle down to a new equilibrium state. This system is clearly not in equilibrium during its transition; however, its behavior is still governed by the first law because the process starts and ends with the system in equilibrium states.

    Polishing a Fitting

    A machinist polishes a 0.50-kg copper fitting with a piece of emery cloth for 2.0 min. He moves the cloth across the fitting at a constant speed of 1.0 m/s by applying a force of 20 N, tangent to the surface of the fitting. (a) What is the total work done on the fitting by the machinist? (b) What is the increase in the internal energy of the fitting? Assume that the change in the internal energy of the cloth is negligible and that no heat is exchanged between the fitting and its environment. (c) What is the increase in the temperature of the fitting?


    The machinist’s force over a distance that can be calculated from the speed and time given is the work done on the system. The work, in turn, increases the internal energy of the system. This energy can be interpreted as the heat that raises the temperature of the system via its heat capacity. Be careful with the sign of each quantity.


    1. The power created by a force on an object or the rate at which the machinist does frictional work on the fitting is \(\vec{F} \cdot \vec{v} = -Fv\). Thus, in an elapsed time \(\Delta t\) (2.0 min), the work done on the fitting is \[\begin{align} W &= -Fv\Delta t \nonumber \\[4pt] &= -(20 \, N)(1.0 \, m/s)(1.2 \times 10^2 \, s) \nonumber \\[4pt] &= -2.4 \times 10^3 \, J. \nonumber \end{align} \nonumber\]
    2. By assumption, no heat is exchanged between the fitting and its environment, so the first law gives for the change in the internal energy of the fitting: \[\Delta E_{int} = -W = 2.4 \times 10^3 \, J.\]
    3. Since \(\Delta E_{int}\) is path independent, the effect of the \(2.4 \times 10^3 \, J\) of work is the same as if it were supplied at atmospheric pressure by a transfer of heat. Thus,
    4. \[\begin{align} 2.4 \times 10^3 \, J &= mc\Delta T \nonumber \\[4pt] &= (0.50 \, kg)(3.9 \times 10^2 \, J/kg \cdot \, ^oC) \Delta T, \nonumber \end{align} \nonumber\] and the increase in the temperature of the fitting is \[\Delta T = 12^oC,\] where we have used the value for the specific heat of copper, \(c = 3.9 \times 10^2 \, J/kg \cdot \, ^oC\).


    If heat were released, the change in internal energy would be less and cause less of a temperature change than what was calculated in the problem.

    Exercise \(\PageIndex{1}\)

    The quantities below represent four different transitions between the same initial and final state. Fill in the blanks.

    Q (J) W (J) \(\Delta E_{int}(J)\)
    –80 –120  

    Line 1, \(\Delta E_{int} = 40 \, J\); line 2, \(W = 50 \, J\) and \(\Delta E_{int} = 40 \, J\); line 3, \(Q = 80 \, J\) and \(\Delta E_{int} = 40 \, J\); and line 4, \(Q = 0\) and \(\Delta E_{int} = 40 \, J\)

    Example \(\PageIndex{2A}\): An Ideal Gas Making Transitions between Two States

    Consider the quasi-static expansions of an ideal gas between the equilibrium states A and C of Figure 3.3.3. If 515 J of heat are added to the gas as it traverses the path ABC, how much heat is required for the transition along ADC? Assume that \(p_1 = 2.10 \times 10^5 \, N/m^2 \), \(p_2 = 1.05 \times 10^5 \, N/m^2\), \(V_1 = 2.25 \times 10^{-3} m^3\), and \(V_2 = 4.50 \times 10^{-3} m^3\).


    The difference in work done between process ABC and process ADC is the area enclosed by ABCD. Because the change of the internal energy (a function of state) is the same for both processes, the difference in work is thus the same as the difference in heat transferred to the system.


    For path ABC, the heat added is \(Q_{ABC} = 515 \, J\) and the work done by the gas is the area under the path on the pV diagram, which is

    \[W_{ABC} = p_1(V_2 - V_1) = 373 \, J.\]

    Along ADC, the work done by the gas is again the area under the path:

    \[ W_{ADC} = p_2(V_2 - V_1) = 236 \, J.\]

    Then using the strategy we just described, we have

    \[Q_{ADC} - Q_{ABC} = W_{ADC} - W_{ABC},\]

    which leads to

    \[Q_{ADC} = Q_{ABC} + W_{ADC} - W_{ABC} = (515 + 236 - 474) \, J = 278 \, J.\]


    The work calculations in this problem are made simple since no work is done along AD and BC and along AB and DC; the pressure is constant over the volume change, so the work done is simply \(p\Delta V\). An isothermal line could also have been used, as we have derived the work for an isothermal process as \(W = nRTln\frac{V_2}{V_1}\).

    Example \(\PageIndex{2B}\): Isothermal Expansion of an Ideal Gas

    Heat is added to 1 mol of an ideal monatomic gas confined to a cylinder with a movable piston at one end. The gas expands quasi-statically at a constant temperature of 300 K until its volume increases from V to 3V.

    1. What is the change in internal energy of the gas?
    2. How much work does the gas do?
    3. How much heat is added to the gas?


    (a) Because the system is an ideal gas, the internal energy only changes when the temperature changes. (b) The heat added to the system is therefore purely used to do work that has been calculated in Work, Heat, and Internal Energy. (c) Lastly, the first law of thermodynamics can be used to calculate the heat added to the gas.


    1. We saw in the preceding section that the internal energy of an ideal monatomic gas is a function only of temperature. Since \(\Delta T = 0\), for this process, \(\Delta E_{int} = 0\).
    2. The quasi-static isothermal expansion of an ideal gas was considered in the preceding section and was found to be \[W = nRTln\dfrac{V_2}{V_1} = nRt ln\dfrac{3v}{V}\] \[= (1.00 \, mol)(8.314 \, J/K \cdot mol)(300 \, K)(ln3) = 2.74 \times 10^3 \, J.\]
    3. With the results of parts (a) and (b), we can use the first law to determine the heat added: \[\Delta E_{int} = Q - W = 0,\] which leads to \[Q = W = 2.74 \times 10^3 \, J.\]


    An isothermal process has no change in the internal energy. Based on that, the first law of thermodynamics reduces to \(Q = W\).

    Exercise \(\PageIndex{2}\)

    Why was it necessary to state that the process of Example \(\PageIndex{2B}\) is quasi-static?


    So that the process is represented by the curve \(p = nRT/V\) on the pV plot for the evaluation of work.

    Example \(\PageIndex{3}\): Vaporizing Water

    When 1.00 g of water at \(100^oC\) changes from the liquid to the gas phase at atmospheric pressure, its change in volume is \(1.67 \times 10^{-3} m^3\). (a) How much heat must be added to vaporize the water? (b) How much work is done by the water against the atmosphere in its expansion? (c) What is the change in the internal energy of the water?


    We can first figure out how much heat is needed from the latent heat of vaporization of the water. From the volume change, we can calculate the work done from \(W = p\Delta V\) because the pressure is constant. Then, the first law of thermodynamics provides us with the change in the internal energy.


    1. With \(L_v\) representing the latent heat of vaporization, the heat required to vaporize the water is \[Q = mL_v = (1.00 \, g)(2.26 \times 10^3 \, J/g) = 2.26 \times 10^3 \, J.\]
    2. Since the pressure on the system is constant at \(1 \, atm = 1.01 \times 10^5 N/m^2\) the work done by the water as it is vaporized is \[W = p \Delta V = (1.01 \times 10^5 \, N/m^2)(1.67 \times 10^{-3}m^3) = 169 \, J.\]
    3. From the first law, the thermal energy of the water during its vaporization changes by \[\Delta E_{int} = Q - W = 2.26 \times 10^3 \, J - 169 \, J = 2.09 \times 10^3 \, J.\]


    We note that in part (c), we see a change in internal energy, yet there is no change in temperature. Ideal gases that are not undergoing phase changes have the internal energy proportional to temperature. Internal energy in general is the sum of all energy in the system.

    Exercise \(\PageIndex{3}\)

    When 1.00 g of ammonia boils at atmospheric pressure and \(-33.0^oC\), its volume changes from 1.47 to \(1130 \, cm^3\). Its heat of vaporization at this pressure is \(1.37 \times 10^6 \, J/kg\). What is the change in the internal energy of the ammonia when it vaporizes?


    \(1.26 \times 10^3 \, J\).


    View this site to learn about how the first law of thermodynamics. First, pump some heavy species molecules into the chamber. Then, play around by doing work (pushing the wall to the right where the person is located) to see how the internal energy changes (as seen by temperature). Then, look at how heat added changes the internal energy. Finally, you can set a parameter constant such as temperature and see what happens when you do work to keep the temperature constant (Note: You might see a change in these variables initially if you are moving around quickly in the simulation, but ultimately, this value will return to its equilibrium value).

    This page titled 14.4: First Law of Thermodynamics is shared under a CC BY license and was authored, remixed, and/or curated by OpenStax.