 # In thermo, i cannot figure out why the work done is not the same. I try to simplify my problem here. Considering again a cylinder with insulated wall is expand adiabatically and piston with surface area of 1m^2 . The cylinder have a volume of 1m^3 and massless piston. The piston is initially at the middle of the partition so volume= length of the end to the piston*surface area of piston=0.5*1=0.5m^3 The pressure inside the cylinder is 4atm. On the other side of the partition consist of a massless spring. I show my calculation in several step so someone can point out where is the mistakeStep 1When the partition expand from it original position by distance x,(x<0.5) than the volume will be (0.5+x)A. So using P1V1^gamma=P2V2^gamma i can formulate it as 4(0.5A)^gamma=P2((0.5+x)A)^gamma. When it move a distance x than the spring will be compress by x disanceStep 2The elastic energy of the spring will be 0.5kx^2. You can try giving any value of K as long as it make sense and will find that the work done by the gas is not equal. P1V1-P2V2/(gamma-1)  is not equal to 0.5kx^2(using the formula above).I been figuring since the internal energy of the gas is nCvdt, why cannot use 3/2RTi=1/2kx^2+3/2RTf where Ti is initial temperature and Tf is final temperature or 3/2P1V1=1/2kx^2+3/2P2V2. But just need to find the point when the force exert on the piston become equal to force exert by the spring. This also agree with in an adiabatic free expansion, since no work is done, it can be treated as an isothermal process.I really can't figure out why it is not conserve. You can try another example considering an infinite long cylinder open end cylinder with insulated wall is expand until the pressure inside is same as the pressure outside. Threating that the pressure outside is atmospheric pressure and it is almost constant. 