In my text book the derivation goes like this:
The minimum speed required to project a body from the surface of the Earth so that it never returns to the surface of the Earth is called escape speed. If a velocity greater than the escape velocity is imparted, the body will escape and leave the surface. If a velocity lesser than the escape velocity is given, it will fall back to the surface or be in an orbit. A body thrown with escape speed goes out of the gravitational pull of the Earth. Work done to displace the body from the surface of the Earth ($r=R_e$) to infinity ($r=\infty$) is given by:
$$\int dW=\int^{\infty}_{R_e}\frac{GM_e m}{r^2}dr$$
or
$$W=GM_e m\int^{\infty}_{R_e}\frac{1}{r^2}dr=-GM_e m\frac{1}{r}\Biggr| ^{\infty}_{R_e}$$
$$=-GM_e m\left(\frac{1}{\infty}-\frac{1}{R_e}\right)\Rightarrow W=\frac{GM_e m}{R_e}$$
Let $v_e$ be the escape speed of the body of mass m, then kinetic energy of the body is given by:
$$\frac{1}{2}mv^2=\frac{GM_e m}{R_e}\Rightarrow v_e=\sqrt{2gR_e}=11.2 \:\text{kms}^{-1}$$
But isn’t work done $Fdx=Fdx\cos z$. The direction of force and displacement is anti parallel but there is no -ve sign in the derivation. Have I misunderstood something?