a) From the standpoint of mechanics, the projection of Newton’s law of motion for the weight, F + Mg = Ma, along a coordinate axis Oz pointing downwards yields,
−F + Mg = M \ddot{z} .
The time evolution of the mechanical energy E^{\prime} is obtained by multiplying this result by \dot{z} ,
\frac{d}{d t}\biggl(\frac{1}{2} M \dot{z}^2-M g z \biggr) =-F \dot{z}.
Since the mechanical energy E^{\prime} is the sum of the kinetic and potential energies,
E^{\prime} = \frac{1}{2} M \dot{z}^2-M g z .
the previous result can be recast as,
\dot{E}^{\prime} = -F \dot{z}.
b) From the standpoint of thermodynamics, the energy of the system E is expressed as,
E = \frac{1}{2} M \dot{z}^2+U .
where U is the internal energy of the system. Since the system consists of the mass M only, its weight is an external force. Thus, the gravitational potential energy is not included in the energy E of the system. Since the internal energy U is a function of the state variables of the system only, it is independent of the height z in the Earth’s gravitational field. Since there is no heat transfer between the weight and the environment, the thermal power vanishes, i.e. P_Q = 0. Furthermore, the weight is assumed rigid, which implies that the mechanical deformation power vanishes as well, i.e. P_W = 0. The external power is due to the weight M g and the force F that can change the kinetic energy of the system,
P^{ext} = F · v + Mg · v = −F \dot{z} +M g \dot{z}.
The first law is expressed as, \dot{E} = P^{ext}, which implies that,
\dot{E} = (−F + Mg) \dot{z}.
Since the internal energy of this particular system is constant, i.e. \dot{U} = 0, the previous result reduces to,
\frac{d}{d t}\biggl(\frac{1}{2} M \dot{z}^2 \biggr) = (−F + Mg)\dot{z}.