[Note that G is the Gravitational Constant equal to 6.6725985E-11(N•m2per kg2). Take Earth Mass/Moon Mass as 81.25 and Earth Radius/Moon Radius as 3.66091954.]
Let the body be shot "straight up" from Earth's surface with velocity vinitial. Use energy considerations to find the minimum velocity that will break the hold of Earth's gravity on the object.
Next, write Total Energy = 0.5mobjectvinitial2 − GMEarthmobject÷REarth which in turn equals
0.5mobjectvescape2 − GMEarthmobject÷Rescape.
This gives the Total Energy of the object at any point when its velocity and distance from Earth's center are known. At Earth's surface, with velocity = vinitial, the distance from Earth's center is simply the radius of the Earth. At maximum altitude, final velocity of the object will be 0 and final radius can be taken as infinity (or ∞).
Total Energy is conserved so obtain 0.5mobjectvinitial2 − GMEarthmobject÷REarth equals
0.5mobjectvfinal2 − GMEarthmobject÷Rescape. This reduces to vinitial2 = 02 + 2GMEarth(1/REarth − 1/∞) or
vinitial (now the same as vescape when on the "edge" of outer space) equals √(2GMEarth/REarth).
For Earth's Escape Velocity, write vescape = √(2GMEarth/REarth). With MEarth at 5.98E24 kg and REarth at 6.37E6 meters, vescape comes to 11192.91924 meters per second or 11.2 km/s.
For Lunar Escape Velocity, one would multiply 11192.91924 meters per second by √[(1/81.25)÷(1/3.66091954)] to find 2375.89245 meters per second or 2.4 km/s.