A polytropic process is a process where [[Pressure|pressure]] and [[Volume|volume]] are related to a constant $C$ and an exponent $n$.
$PV^n=C$
Substituting for P into the [[Boundary Work|boundary work]] equation for total [[Work|work]]:
$W=\dfrac{P_2V_2−P_1V_1}{1−n},\quad n\ne1$
$W=P_2V_2\ln \left(\dfrac{V_2}{V_1}\right), \quad n=1$
Work for a [[Piston Cylinder|piston cylinder]] pressing against a spring:
$W=\dfrac{1}{2}(P_2+P_1)(V_2−V_1)$
Note: For [[Ideal Gas|ideal gases]] we can use ideal gas law to substitute $P_iV_i$ for $mRT_i$ into the work equations. For an ideal gas, when $n=1$ the process is isothermal (constant [[Temperature|temperature]]).