In First law of thermodynamics , work done by the gas is given by pΔV . I have few doubts regarding this- 1)Is 'p' ,pressure of the gas or external pressure of the surroundings ?If gas is expanding then surely gas pressure should be more than that of the surroundings and vica versa . 2)There are three things ,gas,container fitted with piston and surroundings .Now ,gas is exerting pressure on the piston i.e doing work on the piston .Piston is doing work on the surroundings. Then why is that considered as gas doing work on the surroundings ? 3)Is the piston considered in the arrangement always massless or it may have some mass ? How does that affect our results ? I would be grateful if somebody could give his/her inputs .