There is a container of a fixed volume filled with gas. There is a second container with a piston filled with gas. The containers are filled with the same amount of gas, have the same pressure, have the same volume (the piston is placed so the gases of each container occupy the same volume), and are at the same temperature. I add equal amounts of heat to each container. The fixed-volume container increases in temperature; the piston of the second container is pushed out and the gas also increases in temperature. Since the gas in the piston-container does work, does that mean its temperature is less than that of the constant-volume container? I would assume so because the added heat is transferred away as work. Also, how does the relationship between V and T take into account the energy lost, and therefore decrease in temperature, when an expanding gas does work?