# Calculating work done by a gas fitted with a spring

Assume a gas in a container with one end closed and other end has a piston of mass m fixed with a spring.The gas is then heated ,assume that the container is non-conducting.(Assume vessel to be kept in vertical position and the spring is on top).

I have doubt that since the the piston is connected to the spring the pressure inside the gas varies and temperature also varies because the vessel is non-conducting and volume is also not fixed. Then we can calculate the work done by the gas if during the piston has moved 'd' distance. I can't understand how to begin?

• What do the words “the gas is heated” mean to you? – Chet Miller May 28 '18 at 16:26
• Assume there is a heater attached and the gas inside the vessel is heated means we are giving heat energy to the gas. – user190625 May 28 '18 at 16:28

From your question, I am not entirely sure what information you know about the system, so I will make some assumptions below. Hopefully it will help get you started at least.

For a spring, we know that the spring force is $F_{S} = kx$ (Hooke's Law). We also know the definition of work $W = Fd$.

Assuming the piston does not accelerate, the force exerted by the gas is the same as the force exerted by the spring. Assuming that we know the spring constant $k$, and the distance $d$, we can calculate the work done by the gas over a tiny interval $dx$ as $F_{s} \cdot dx$. We get the total work done by the gas by integrating:

$$\int_{0}^{d} F_{s} \ dx = \int_{0}^{d} kx \ dx = \frac{1}{2}kd^{2}$$

• I got the idea that if we use work energy theorm,then work done by atmosphere+work done by gas+work done by spring =0 so, work done by gas =1/2*kd² +P(atmospheric pressure)*Ad+mgd. Is this method correct? – user190625 May 28 '18 at 16:07
• Let m=mass of piston – user190625 May 28 '18 at 16:12
• Good point, this will depend on the orientation of the setup. When I was imagining it, I was imagining it being pushed horizontally. If it is moving vertically I agree with your solution, because the force of the gas must counteract atmospheric pressure and gravitational force on the piston. – Martin J May 28 '18 at 19:04
• One of my friend gave me answer that using Newton's law on piston: mg+P(atmospheric)A + K*x =P(gas)A then he integration the whole equation and the same answer came.But in his method he assumed that pressure inside the gas remains same,I have doubt that pressure inside varies and not remains same. – user190625 May 28 '18 at 19:16
• Plz help me with this doubt – user190625 May 28 '18 at 21:51