Work done by the system of gases