On this page
A gas in a cylinder pushes a piston, and a spring pushes back. As you heat the gas, the pressure is not constant, the process is not isothermal and it is not adiabatic, so none of the standard formulas apply directly. This post shows how to write the pressure as a function of volume, find the work from the area under the P-V line, and close the energy balance, with two worked examples.
Is this in the syllabus?
The Syllabus for JEE (Main) 2026 lists "work done on compressing a gas" under kinetic theory and "the first law of thermodynamics" under thermodynamics. The JEE (Advanced) 2026 Information Brochure lists "First law of thermodynamics and its applications (only for ideal gases)". A spring-loaded piston combines these with spring energy from mechanics. NCERT's chapter Thermodynamics gives the tools: ΔQ = ΔU + ΔW (equation 11.1) and ΔW = PΔV at constant pressure. Check the current year's documents before your exam.
How do you find the gas pressure?
Draw the forces on the piston. For a light piston of area A, with atmosphere at P₀ outside and a spring of constant k compressed by x:
PA = P₀A + kx, so P = P₀ + kx/A
For a heavy vertical piston, add its weight: P = P₀ + mg/A + kx/A. Since the volume is V = V₀ + Ax, the pressure rises linearly with volume:
P = P₀ + k(V − V₀)/A²
On a P-V diagram this is a straight line, so the work done by the gas is the area of a trapezium.
Worked example 1: heating against a spring
A light piston of area 0.010 m² traps 2.0 × 10⁻³ m³ of a monatomic ideal gas at 300 K and 1.0 × 10⁵ Pa. A spring of constant 2000 N/m touches the piston at its natural length, and the atmosphere outside is at 1.0 × 10⁵ Pa. The gas is heated slowly until the piston has moved 0.10 m.
Final volume: V₂ = 2.0 × 10⁻³ + 0.010 × 0.10 = 3.0 × 10⁻³ m³.
Spring force: kx = 2000 × 0.10 = 200 N, adding 200/0.010 = 2.0 × 10⁴ Pa. So P₂ = 1.2 × 10⁵ Pa.
Final temperature: T₂ = T₁ × (P₂V₂)/(P₁V₁) = 300 × 360/200 = 540 K.
Work by the gas: P₀ΔV + kx²/2 = (1.0 × 10⁵ × 1.0 × 10⁻³) + (0.5 × 2000 × 0.10²) = 100 + 10 = 110 J. The trapezium agrees: average pressure 1.1 × 10⁵ Pa times 1.0 × 10⁻³ m³.
Change in internal energy: for a monatomic gas ΔU = (3/2)μRΔT = (3/2)(P₂V₂ − P₁V₁) = 1.5 × (360 − 200) = 240 J.
Heat supplied: Q = ΔU + W = 240 + 110 = 350 J.
Step 5 never needed the number of moles (about 0.080 mol, with R = 8.314 J/(mol K)). Writing ΔU in terms of PV saves a step.
Worked example 2: a spring alone, with vacuum outside
Now the other side of the piston is a vacuum, and the spring is at its natural length when the piston touches the closed end, where V = 0. Then P = kx/A and V = Ax, so P = (k/A²)V: pressure is proportional to volume. For μ moles of a monatomic gas heated by ΔT:
W = ½(P₂V₂ − P₁V₁) = ½μRΔT
ΔU = (3/2)μRΔT
Q = 2μRΔT, so the molar heat capacity for this process is 2R
This is the process PV⁻¹ = constant, which our post on polytropic processes treats in general.
Which mistakes cost marks?
Leaving out atmospheric pressure, or adding it when the outside is a vacuum.
Using the final pressure for the whole expansion. Pressure changes, so use the average for a straight line, or integrate.
Treating the spring energy as heat. It is part of the work done by the gas, stored as elastic energy.
Guessing the spring's direction. Whether it is compressed or stretched, it opposes the piston's motion; write the forces from a diagram.
Using these results for a sudden expansion. They assume the piston moves slowly, through equilibrium states.
For the mechanics side of the balance, see our post on spring-block systems: energy and compression.
Why does the energy balance trip students up?
Loverude, Kautz and Heron (2002) found that university students who had studied the first law rarely recognised its relevance when a gas was compressed, and fewer still could use the idea of work to explain a temperature change. A spring-piston question tests exactly that link. The fix is a fixed order: force balance on the piston, P as a function of V, area for W, then ΔU, then Q.
A practice routine
Day 1: two problems with a light piston and atmosphere, writing the force balance first.
Day 2: one heavy vertical piston and one with a vacuum outside.
Day 3: one problem where Q is given and you must find the final temperature, which needs a quadratic in x.
Day 4: repeat example 1 from a blank page without looking, then check each line. Students in a study by Roediger and Karpicke (2006) who recalled material by testing themselves remembered more two days and a week later than those who restudied it.
When the force diagram is where you get stuck, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Pick one spring-piston problem tonight and write its force balance and its P-V line before you touch the first law.



