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?