An exercise in my book states the following:
n = 0.42 moles of an ideal biatomic gas are stored in an adiabatic cylinder with volume $V = 10^{-2} \text{ m}^3$, with an initial pressure equal to one atmosphere $p_\text{atm}$. A small solid object at a temperature $T_0 = 580 \text{ K}$ is placed very quickly inside the cylinder; its volume is negligible when compared to $V$. Once the temperature has reached its equilibrium at $T_1$ the object is removed very quickly, and one of the cylinder's bases is let go so that it can freely slide until the gas reaches a new equilibrium at a pressure $p_\text{atm}$ equal to the one applied externally, which has remained constant through the whole process, during which it does a work equal to $W = 705.4 \text{ J}$. Calculate the object's thermal capacity and the change in the gas' entropy.
In the solutions at the end of the book, it finds the initial temperature of the gas to be $T = 289.2 \text{ K}$ using the ideal gas law, and then it says that the expansion is adiabatic since there is no heat transfer, and that it can be assumed to be reversible.
The solution then states that the work done by the gas during the adiabatic expansion is
$$
W = p_\text{atm} (V_2 - V)
$$
I understand that the pressure outside the cylinder is constant, but since this is the work done by the gas shouldn't one consider the gas's pressure instead of the external one?\
I don't understand why work is calcualted that way, since pressure varies in an adiabatic expansion, and if that expansion is reversible it should hold that
$$
p_f = \left(\frac{V_i}{V} \right)^{\gamma} p_i
$$
The solutions then also claim that the work done is
$$
W = -n c_v (T_2 - T_1)
$$
Where $T_2$ is the final temperature after the expansion. This is what I expected the correct expression for the work to be, as it is the opposite of the change in the internal energy.
So are the solutions wrong? And if they aren't, why is the work equal to the one done in an isobaric expansion?