[Physics] Pressure Volume graphs and work done

pressuretemperaturethermodynamicsvolumework

So if I have a system where pressure, volume, and temperature change, how do I find the work done on the system? I look at an example where you simply use
$\mathrm{d}W =-p\, \mathrm{d}V$, but I disagree with this because surely if pressure has changed then this can't include that fact.

Then I tried to find work by integrating $p(V)\,\mathrm{d}V$ where the boundaries are the change in V. This, however, leaves a factor of temperature T in the final answer suggesting it's dependent on just 1 value of [? something missing from OP?] as if the system is isothermal which is not true. Could I use the 1st law of thermodynamics? I can't decide if this is the correct direction of work in terms of whether the work is done by or on the system?

Can someone point out why I'm getting confused, please?

Best Answer

The work done on a gas is

the negative of the area under the $pV$ curve between $V_i$ and $V_f$ (Knight, Physics for Scientists and Engineers, 3rd edition, page 473)

So $$W=-\int_{V_i}^{V_f} p\,\mathrm{d}V .$$

What you must keep in mind is that $p$ can be a function of $V$ and/or $T$. In order to actually do the integral, you must replace $p$ by its functional form.

You might use the ideal gas law to get $$p=\frac{nRT}{V}.$$ Then you would need to find the function for $T$, unless the process is isothermal (constant $T$). Or there might be another gas law such as van der Waals. If the process is not isothermal, it might be adiabatic which gives you a second equation, $$p_iV_i^{\gamma}=p_fV_f^{\gamma},$$ to combine with your gas law to find the appropriate function for $p$.

Bottom line: $p$ is not necessarily a constant in the work integral. It can be a function. The type of process determines how you treat $p$.

Also note that if the volume of the gas doesn't change, no work is done on or by the gas.