# 2.2: Work and the integral; constant vs. variable pressure

$$\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}}$$

We have a definition of work already set:

$w equals upper F normal upper Delta x cosine theta left-parenthesis single constant force acting on single object right-parenthesis$

This definition sets a sign convention for work, as we’ve said before; forces in the same direction as an object’s displacement result in positive work done, and forces in the opposite direction as the displacement yield negative work; we can characterize positive work as work done on a system and negative work as work done by a system in this way. Like heat, work is a process energy; no system possesses work, but work is performed on a system.

Consider the system to be a gas in a closed container, as shown above and at right; the force is applied to the gas by a piston of area A, which is displaced a distance of Δx. Knowing the area of the piston allows us to do two things: we can recognize pressure in the force per unit area, and we can also recognize the change of volume in the system from the product of the area and the displacement. This has the effect of multiplying the work relation by 1:

$w equals StartFraction upper F Over upper A EndFraction left-parenthesis upper A normal upper Delta x right-parenthesis equals minus upper P Subscript e x t Baseline normal upper Delta upper V left-parenthesis single constant force applying pressure on a gas system right-parenthesis$

The pressure here is that which is applied from the outside of the gas; the positive work results from the motion of the piston in a way that decreases the volume of the gas, which introduces a negative sign to the work relation. To do work on a gas, you must decrease its volume; to have work done by a gas, the volume of the gas must increase.

The mathematics here is very straightforward as long as the pressure applied externally to the gas is constant. Realistically, that’s not going to be the case; usually, some kind of increase in pressure is going to be necessary to start the piston moving, and if the piston moves rapidly that will require a pressure that constantly changes. Even studying the ideal gas law solved for pressure (P=nRT / V) provides a model of the number of different ways that pressure can change as a function of the other terms of the variables of state.

Calculus gives us tools to study the transition from a determination that’s dependent on a constant quantity to a determination that’s dependent on a variable quantity. The first step of building this extension is to change the quantities w and ΔV from discrete quantities to quantities that have differential size - very very small in nature:

$delta w equals minus upper P d upper V$

Then what happens is integration - adding up the very small changes over the range of the transition:

$integral Underscript p r o c e s s Endscripts delta w equals minus integral Subscript upper V Subscript i Baseline Superscript upper V Subscript f Baseline Baseline upper P d upper V$

The quantity δw is what is known as an imperfect differential. You can’t integrate something from initial-work to final-work when work isn’t a property of state, merely a property of a process. You can add up the individual differential processes that lead to the whole. So an integral that looked like “w δw” will never be performed; integrating δw will add up to the total work done:

$w equals minus integral Subscript upper V Subscript i Baseline Superscript upper V Subscript f Baseline Baseline upper P d upper V$

dV, however, is a proper differential and can be integrated over traditionally. If P is a constant (that is, if the process of changing the volume of the gas is isobaric), dictated by the external pressure, P can be simply removed from the integral in order to regenerate the relationship we had before:

$w equals minus upper P Subscript e x t Baseline integral Subscript upper V Subscript i Baseline Superscript upper V Subscript f Baseline Baseline d upper V equals minus upper P Subscript e x t Baseline normal upper Delta upper V$

This isn't all that interesting.

But we can also use this opportunity to consider what it looks like when moles and temperature are held constant - that is, the container is closed and the process of changing the volume is isothermal. In that case, we can replace P with a term that’s solved out of the ideal gas law:

$upper P equals StartFraction n upper R upper T Over upper V EndFraction right-arrow w equals minus integral Subscript upper V Subscript i Baseline Superscript upper V Subscript f Baseline Baseline StartFraction n upper R upper T Over upper V EndFraction d upper V$

(There's an implied assumption in this substitution - we are asserting that the external pressure applied as the volume changes is equivalent to the pressure inside the container. This should make sense on the surface - if we think about this change of volume as a compression, then the pressure required to continue the compression is going to increase as the volume of the gas gets smaller. But this actually demands a more subtle implication to be accurate as a integration - that the change in volume is slow, gradual, and reversible. Practical attempts to make isothermal changes in volume are not reversible. We won't bother ourselves too much with this distinction right now - but we will have to think about it later.)

This integration isn't as direct as it would be if the pressure were constant; it requires the taking of an antiderivative, in this case the antiderivative of 1/V

$w equals minus n upper R upper T integral Subscript upper V Subscript i Baseline Superscript upper V Subscript f Baseline Baseline StartFraction 1 Over upper V EndFraction d upper V equals minus n upper R upper T left-bracket ln upper V right-bracket Subscript upper V Sub Subscript i Superscript upper V Super Subscript f Baseline equals minus n upper R upper T ln StartFraction upper V Subscript f Baseline Over upper V Subscript i Baseline EndFraction$

At any point in this process, we could have chosen to get rid of the negative sign by swapping the limits on the integral, so this is an equivalent expression:

$w equals n upper R upper T ln StartFraction upper V Subscript i Baseline Over upper V Subscript f Baseline EndFraction$

All of these expressions dictate a sign convention for work that turns what we expect in signs on its head. If the volume of the gas we’re studying in this particular example is decreasing, the sign of work that results is positive. If the volume is increasing, the volume that results is negative.

This might seem backwards. But it’s more satisfying to consider the signs in terms of how they impact the energy of the system as a whole.

The first law of thermodynamics: the two ways to change the internal energy of a system are first through the release or absorption of heat, and second through the performing of work, either on the system or by the system.

$normal upper Delta upper U equals q plus w$

 If the sign is positive... If the sign is negative... q then the system’s temperature increases then the system absorbs heat then the system's temperature decreases then the system releases heat w then the system’s volume decreases then work is done on the system then the system's volume increases then work is done by the system ΔU then the total energy of the system increases then the total energy of the system decreases

Both positive values of heat and work correspond to energy being added to the system in question. If heat transfer is positive, then heat has been absorbed by the system, causing the total energy of the system to increase. If work is positive, then work has been done on the system, causing the total energy of the system to increase.

We’re making important assertions with these terms of our sign conventions. Strictly speaking, it is possible for a system to absorb or release heat without changing temperature; consider a phase change, for example. However, for gas systems, we can assert with confidence that if the temperature does not change, there’s been no heat absorbed or released, and any amount of internal energy change comes from work done. And we can also assert that if the volume of a system does not change, no work is done on or by the system, and any internal energy change comes from heat.

This will be critically important as we build the key definitions that surround our measurement of heat.

2.2: Work and the integral; constant vs. variable pressure is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.