To get oriented with the energy considerations in a thermodynamic system, let us consider a simple system of a gas contained in a cylinder with movable piston as in
FigureΒ 24.1. Suppose the cylinder and piston are
thermally insulated from the environment.
Let us examine a process in which gas is being compressed. Suppose the force on the piston by the spring is infinitesimally larger than the force by the gas so that the piston moves by a distance \(\Delta x \lt 0\) into the gas, corresponding to change in volume \(\Delta V \lt 0\text{.}\) The work done by the spring force will be
\begin{equation*}
W_\text{by spring on gas} = -F\Delta x \gt 0.
\end{equation*}
During this time \(F \approx pA\) and \(\Delta V = A\Delta x\text{.}\) Thus, we can rewrite the work in state properties of the gas.
\begin{equation*}
W_\text{by spring on gas} = -p\Delta V \gt 0.
\end{equation*}
The work by the gas will be opposite of this and so will have opposite sign.
\begin{equation}
W_\text{by gas} = p\Delta V\ \lt 0.\tag{24.1}
\end{equation}
In the gas compression, we find that work by the gas is negative but the energy of the gas goes up since energy flows from the spring to the gas. Thus, we state the change in energy of the gas (our system) by the following equation.
\begin{equation*}
\Delta E_\text{of gas} = -W_\text{by gas} = -p \Delta V.
\end{equation*}
Let us drop the subscript βby gasβ and write this for an infinitesimal process.
\begin{equation}
dE = -pdV.\ \ \ \text{(thermally insulated system)}\tag{24.2}
\end{equation}
The negative sign also work for the process in which gas is expanding, thus reducing its energy by the work by the gas will be positive. Here, we see the exchange of energy occur through the performance of a mechanical work. Next we will see another mechanism of exchange of energy.
Example 24.6. Work Done by an Ideal Gas in a Constant Temperature Process.
A gas cylinder with a movable piston contains
\(n\) moles of an ideal gas in state
\((p_1, V_1, T_1)\text{.}\) The gas expands by moving the piston slowly in a process where temperature is maintaind at
\(T_1\) to a final state of the gas
\((p_2, V_2, T_1)\text{.}\) What is the work done by-the-gas?
Answer.
\(-nRT_1\ln\frac{V_2}{V_1}\text{.}\)
Solution.
Since the gas is an ideal gas, at every point in the process it will abide by the the ideal gas law
\begin{equation*}
pV = n R T,
\end{equation*}
so that we will have \(p\) in terms of \(V\) at every point of the process. With \(T=T_1\) we have
\begin{equation*}
p = \frac{nRT_1}{V}.
\end{equation*}
Using this in the formula for work and taking the constant outside the integral we get
\begin{equation*}
W = -\int\,p\,dV = -nRT_1\int_{V_1}^{V_2}\,dV = = -nRT_1\ln\frac{V_2}{V_1}.
\end{equation*}
Here, we can replace \(nRT_1\) by \(p_1V_1\) since \(p_1V_1 = n RT_1\text{.}\)