# Calculating work done on an ideal gas

I am trying to calculate the work done on an ideal gas in a piston set up where temperature is kept constant. I am given the volume, pressure and temperature.

I know from Boyle's law that volume is inversely proportional to pressure that is,

$$V \propto \frac{1}{p}$$

using this I can calculate the two volumes I need for this equation to calculate work done:

$$\Delta W = - \int^{V_2}_{V_1} p(V)dV$$

but what I do not understand is how to use this equation to help me calculate the work done, I think I am confused by the fact that I need to have $p(V)$ but I am not sure what this is. If you could help me to understand this, that would be great

-
In this usage $p(V)$ is simply referring to a function relating pressure to Volume. You will want to use the ideal gas law. – Michael Leonard Oct 22 '12 at 4:45

## 2 Answers

Try the ideal gas law

$$p V = N k_B T \Leftrightarrow p = N k_B \frac{T}{V}$$

since $N$, $k_B$ and $T$ are constant, we have

$$\Delta W = - N k_B T \int_{V_1}^{V_2} \frac{\textrm{d}V}{V} = - N k_B T \left( \ln(V_2) - \ln(V_1)\right)$$

-
In your first equation you have $pV=Nk_BT \Leftrightarrow p=Nk_B\frac{T}{V}$ shouldn't it be $p=\frac{Nk_BT}{V}$? If it isn't then could you explain how the rearrangement happens? – Aesir Oct 21 '12 at 21:58
$a \cdot \frac{b}{c} = \frac{a\cdot b}{c}$. – Claudius Oct 22 '12 at 8:26

The answer by Claudius is correct with one assumption: That is that the process is reversible. In other words the process must take place so slowly that the system is always in equilibrium.

Why is this important? Because the definition of work is really $$W = -\int_{V_1}^{V_2} p_{ext} dV$$ Note the $p_{ext}$. That's the external pressure because doing work is equivalent to raising a weight in the earth's gravitational field.

In a reversible process the external and internal pressures are always equal, so one can use $p = nRT/V$, where $p$ here is the internal pressure, in place of the external pressure.

In nonequilibrium situations one has to know how $p_{ext}$ varies with the volume of the system. And usually we don't. For instance, expansion against zero pressure does no work, while expansion against a constant external pressure does $$W = -p_{ext} (V_2 - V_1)$$ work. Can you see why?

-
Reversibility is a good point which I forgot to mention, yes. However, in this case, it is equivalent to the assumption that the ideal gas law always holds, which I would find to be implied by the fact that we, indeed, have an ideal gas? – Claudius Oct 22 '12 at 8:27