The expression for work of a polytropic process W = (p2 V2 - p1V1/1 - n) is not restricted to ideal gases. While the expression PV=mRT relating pressure, volume and temperature is only valid for ideal gases, the polytropic process expression can be used for any fluid.