We have an isolated cylinder, inside of it is an ideal gas. The pressure is constant (note that the thing where the constant force is acting upon can move up and down). We bring some work to the gas. The first law of thermodynamics states:
Q1-2=U2-U1+W1-2
(U2-U1 is change in internal energy). Considering that the system is isolated we can re-write this as:
W1-2=U1-U2
Let's suppose we bring 1 joule of work to the system. Using the formula above, that work will cause a change in internal energy. But if internal energy increases, that means the temperature also increases. And since:
pV=mRT
is a formula of ideal gas, if temperature rises, the volume will also rise (since other numbers are constant). Positive change in volume means that the gas is doing work.
To summarize: we bring work to the gas, it's temperature rises, it's volume increases. I don't understand where is that work done by the gas visible in the formula for the first law of thermodynamics? What am I doing wrong? All I see is that the work I brought increased it's internal energy.