Assuming a vacuum above the earth's surface
The simplest thing to do is to use "conservation of energy". The gravitational force on the rocket is GMm/r2 where G is the universal gravitation constant, M is the mass of the earth, m is the mass of the spaceship and r is the distance from the center of the earth. The work necessary to "escape from earth" is the integral of that, with respect to r, from the surface of the earth to an infinite distance away. Assuming that you start with initial speed v and apply no more force (not what a space ship does but the standard way of computing "escape velocity", you must have that much kinetic energy to exchange for potential energy. Set that integral equal to (1/2)mv2 and solve for v. Notice that the mass of the space ship, m, appears on both sides of the equation and can be cancelled.
What do you mean when you say the work is the integral of that with respect to r?
Can you just set the KE of the object equal to the Gravitational force and solve for v? Wouldnt that give you the escape v?
Separate names with a comma.