1st Method: Work done by external agent is positive, because Fext and displacement are in the same direction . Since walls are conducting therefore temperature ramains constant.
Applying equilibrium condition when pressure of the gas is P
`PA + F_("ext") = P_("atm")A`
`F_("ext") = P_("atm")A - PA`
`W_("ext") = int_(0)^(d) F_(ext) dx = int_(0)^(d) P_("atm") Adx - int_(0)^(d) PA dx`
`= P_("atm")A int_(0)^(d) dx - int_(V)^(2V) (nRT)/(V) dV`
`= P_("atm")Ad - nRT 1n2`
`= P_("atm"). V_(0) - nRT 1n2 = nRT (1 - 1n)`
2nd Method : Applying work erergy theorem on the piston
`Delta k = 0`
`W_("all") = Delta k`
`W_("gas") + W_("atm") + W_("ext") = 0`
`nRT 1n (V_(1))/(V_(1)) - nRT + W_("ext") = 0`
`W_("ext") = nRT (1 - 1n2)`