The work done depends on the process through which the gas is taken.
from 1st law dQ-dU=dW. One should remember that dU=nCvdT always.
But dQ=nCdT where C depends on the process. The key ides is to express the process in terms of P and V.
suppose the process is P * (V^k)=const then the value of C=Cv + R/(1-k).
putting this value we have dW= nR/(1-k) dT.