Example Problem with Complete Solution

4A-4 : Expansion of a Gas in a Cylinder Against a Spring 5 pts
A gas is held in a horizontal piston-and-cylinder device, as shown below.
A spring is attached to the back of the frictionless piston. Initially, the spring exerts no force on the piston. 
The gas is heated until the pressure inside the cylinder is 650 kPa.  Determine the boundary work done by the gas on the piston. Assume Patm = 100 kPa.
Read : The key to solving this problem is to determine the slope and intercept for the linear relationship between the force exerted by the spring on the piston and the pressure within the gas.  This relationship is linear because the pressure within the cylinder is atmospheric pressure plus the spring force divided by the cross-sectional area of the piston.
Given: P2 650 kPa Dpiston 0.0508 m
P1 = Patm 100 kPa k 3.25 kN/m
Find: W = ??? kJ
Assumptions: 1 - The gas in the cylinder is a closed system.
2 - The process occurs slowly enough that it is a quasi-equilibrium process.
3 - There is no friction between the piston and the cylinder wall.
4 - The spring force varies linearly with position.
Equations / Data / Solve:
For a quasi-equilibrium process, boundary or PV work is defined by:
Eqn 1
It is critical to note that the gas must overcome the force due to atmospheric pressure AND the force of the spring during this expansion process.  Because the force exerted by the linear spring on the piston increases linearly as the gas expands, we can write the following equation relating the force exerted by the gas on the piston to the displacement of the piston from its original, unstretched position.
Eqn 2 Where x is the displacement of the piston from its initial position.
Plug Eqn 2 into Eqn 1 and integrate to get :
Eqn 3
Where x2 is the displacement of the spring in the final state.
So, our next objective is to determine how far the piston moved during this process.
In the initial and final states, the piston is not accelerating.  In fact, it is not moving.  Therefore, there is no unbalanced force acting on it.  This means that the vector sum of all the forces acting on the piston must be zero.
Initial State:
Eqn 4 P1 100 kPa
The relationship between force and pressure is:
Eqn 5
Where :
Eqn 6 Apiston 2.03E-03 m2
Fatm 0.2027 kN
Final State:
Eqn 7
or :
Eqn 8
Now, plug numbers into Eqn 8 : F2 1.1148 kN
Because the spring is linear :
Eqn 9
or :
Eqn 10
x2 0.3430 m
Finally, substitute back into Eqn 3 to evaluate the work done by the gas in the cylinder on its surroundings during this process :
W = 0.26070 kJ W 260.7 J
Verify: None of the assumptions can be verified using only the information given in the problem statement.
Answers : W 261 J