Not homework per se, but this is giving me so much problems in their resolution: long story short, dealing with the 1st Principle, which would be the proper way to note down energetic exchanges in a closed system? I'm coming here from handling hydraulic systems with springs attached, and one or several spaces where ideal gases get compressed and exchange heat and work with the exterior. The teacher has advised us to use two equations in the fashion of: (1) dQ+dW = dE = dU+dEm (Q=Heat, W=Work, dE=Overall energy exchange, dU=Internal energy exchange, dEm=Mechanical energy exchange) (2) dEm = dEc+dEp = dW-dEi+pdV+xdX (dEc=Kinetic energy, dEp=Potential energy, dW=Work, dEi=Friction losses, pdV=Expansion/Compression Work (of the system, if deformable), xdX=any other deforming work) Problem with this is calling twice in both equations work, ESPECIALLY when in several places both terms equate to different works, exerted by either the system on the environment or the other way around. When replacing dEm in (1) with the equivalence in (2), sometimes work clears out, sometimes it doesn't! And I believe the problem comes from the own teacher taking into account other work equations that do not figure in this scheme. EG: W = S(F·dx), given any force acting in or upon the system. It confuses me terribly and it's giving me a headache even in relatively simple questions. I think the teacher should put it all in a single place in either of the equations but I'm so clueless I don't know even how to fix this so it works for me. Anybody would care to clear this up for me?