A horizontal cylinder is fit with a frictionless and massless piston. Inside the cylinder there is a mono-atomic gas. Outside pressure is Po. The piston is connected with a spring (of spring constant K) the other end of which is connected with the walls of the cylinder. (the spring lies withing the cylinder). My question is when we use first law of thermodynamics, W + delta(Q) = delta(E_int). then shall we calculate the 'W' as work done by the gas, or work done by the gas and spring both. Please explain the reason as well. To do this problem, I am using the equation, that I learned in work energy theorem; W + delta(Q) = delta(K) + delta(U) + delta(E_int). Here, i am using delta(K) = 0 as i am not considering velocity of COM of the system.