The escape velocity is the speed that an object must have in order to have enough energy to escape the Earth's gravitational field. To calculate the escape velocity, we can apply the principle of Conservation of Energy, which states that energy cannot be created or destroyed. We equate the total energy that the body has when it is on the surface of the Earth with the total energy it has when it is infintely far away and no longer experiences the Earth's gravity:
Energy on the surface of Earth = Energy at infinity
The total energy at each point will be the sum of the kinetic energy of the body (0.5mv2) and its gravitational potential energy (-GMm/R).
On the surface of the Earth, it's kinetic energy will be 0.5mve2, where ve is its escape velocity. It's gravitational potential energy will be -GMm/R0, where R0 is the radius of the Earth. We assume that the object has just enough energy to reach infinitely far away from the Earth, which means that it has no kinetic energy once it has reached infinity, and has therefore come to rest. It's gravitational energy will also be zero at infinity, because that is how gravitational potential energy is defined (you can see from the expression for gravitational potential energy that as the distance R becomes very large, i.e. infinitely large, it becomes infinitely small).
We place all of these quantities in the expression above to obtain:
0.5mve2 – GMm/R0 = 0 + 0
We can cancel the mass of the body, m, from everything on the left hand side:
0.5ve2 – GM/R0 = 0
And move the GM/R0 onto the right hand side:
0.5ve2 = GM/R0
We multiply everything by 2 and take the square root to make ve the subject of the formula:
ve = (2G*M/R0)0.5
Substituting in some numbers (G = 6.67x10-11 m3 kg-1 s-2, M = 5.97x1024 kg, R0 = 6.271x106 m):
ve = 11.2 km/s
It is important to note here that we are neglecting the effects of air resistance as is often done in these calculations. Air resistance would transfer energy from the escaping object into thermal energy in the atmosphere, reducing the object's total energy as time passed. Therefore, more energy would be required at the start, and hence the speed at the start would need to be higher.