# Struggling with whether its $\pm p dV$

I am struggling to understand when calculating the work done by a gas whether it is postive or negative p. It my notes and in many other notes sometimes it is $-pdV$ and sometimes it is $pdV$.

I think I have come up with a way to rectify this and it would be to compute the work done using $p dV$ then add a minus afterwards if necessary to make it comply with the first law.

Is this a good way of dealing with it or is there a better way of deciding whether it should be $\pm p$?

If the volume is describing your system then $dV <0$ and so $dE=-PdV>0$ is the correct expression
If the volume is the volume outside the system then $dV>0$ and then $dE= +PdV >0$ is the correct expression
• I have the $E=\frac{f}{2}pV$ which would imply that increasing volume increases the energy? This doesnt agree with your second sentence? – Permian May 23 '15 at 18:38
• Your comment is about slightly different thing. Even for non-ideal gas $E=E(S,V,N)$ so $E(S,V,N)=\frac{f}{2} p(S,V,N) \cdot V$. Because of the dependence of preassure on entropy and volume - you cannot state apriori from that formula that for greater volume the energy is greater. (It depends for example on the process by which the volume expanded - adiabatic or not). I talked about the 1st law of thermodynamics which seperates the change in energy by doing work on the system ( $d W=-PdV$ ) and heat transfer ($d Q$ ) – Alexander May 24 '15 at 1:43
• $dE=-PdV=\frac{f}{2}(PdV+VdP)$ then $-(1+\frac{2}{f}) \frac{dv}{v}=\frac{dp}{p}$ and finaly you get $pv^{\frac{2+f}{f}}=const$ which is the poisson equation for ideal gas (adiabatic prosess, as initialy stated by $dE=-PdV$) – Alexander May 24 '15 at 10:13