To solve this problem we will apply the concepts related to energy conservation. So that the initial energy on the system is equivalent to the final energy.
The initial or final energy will also be the TOTAL mechanical energy of the body.
In the case of the initial energy we will have two types of energy on the body: Kinetic energy and potential energy.
For the case of the final energy we will only have the potential energy in terms of the height
, the mass m, and the gravity g




The total mechanical energy will be equivalent in the terms required, to the final potential energy.