Hi Chet,
In the equation (3), why did you use -(f/A)dV for the work done by the system on the surrounding? Isn't it supposed to be the external pressure to the surrounding (that is the pressure of the system P) that matter?
Or is it because f = (P-F-mg)? If this is the case, how do you know...