For such questions we have to use the idea of conservation of energy, 

i.e. total energy will be same throughout the path.


So, total energy at highest point =E = PE + KE = mgh

(KE = 0, as the object is at rest)


Therefore, E = mgh = 40 x 10 x 5= 2000 Joules or 2 Kilo Joules.

Since total energy remains constant , hence at height 2m from the ground the energy is 2000 Joules