Formula of escape velocity While establishing relation of escape velocity and radius , I confronted a problem .
(i) $$v_e=\sqrt{\frac{2GM}{R}}$$  
This states that $v_e$ is inversely proportional to the square root of radius .
(i) $$v_e=\sqrt{2gR}$$
This states that $v_e$ is directly proportional to the square root of radius .
Whoch one’s correct?
 A: When you write a relationship between two variables $x$ and $y$  as $y \propto x$ you can also write this as $y=kx$ where $k$ is a constant independent of $x$ and $y$.    
Assume  that $R$ is the radius of the planet, $M$.
Using your first equation you stated that the escape velocity $v_{\rm c}$ is inversely proportional to the square root of the radius, $\sqrt R$, provided that the mass, $M$, is constant.
But you have a problem because assuming that it is a homogeneous spherical planet of density $\rho$ the mass $M = \frac 43 \pi R^3 \rho$ and the mass depends on the radius so what you assumed to be a constant, $2GM$,  is not independent of the radius.
For the second equation you are saying that the escape velocity $v_{\rm c}$ is proportional to the square root of the radius, $\sqrt R$, provided  $g$ is constant.
However $g = \frac{GM}{R^2}$ so it is in fact also dependent on $R$ thus invalidating your second proportionality. 
You can however show that if the density is constant then the escape velocity from a homogeneous spherical planet is proportional to the radius of the planet.
A: You can derive the scape velocity by calculating the energy at the surface and then at infinity
$$
E_{\rm surf} = \frac{1}{2}mv^2 -G\frac{M m}{R} \tag{1}
$$
You want to find $v$ such that the mass $m$ reaches infinity $r\to\infty$ with zero velocity, that is
$$
E_{\inf} = 0 \tag{2}
$$
If you put these two equations together
$$
\frac{1}{2}mv_e^2 - G\frac{Mm}{R} = 0 ~~~\Rightarrow~~~ v_e = \left(\frac{2GM}{R}\right)^{1/2} \tag{3}
$$
But now, the force that $m$ feels on the surface is
$$
F = -G\frac{Mm}{R^2} = -\left(\frac{G M}{R^2}\right)m = -g m ~~~\mbox{with}~~~ g = \frac{GM}{R^2}\tag{4}
$$
Replacing Eq. (4) in Eq. (3) you get
$$
v_e = \left(2 g R\right)^{1/2} \tag{5}
$$
A: $g$ is defined as:
$$g=\frac{GM}{R^2}$$
The escape velocity is:
$$v_{e}=\left(\frac{2GM}{R}\right)^{0.5}$$
You can write this equation in terms of $g$ doing this trick:
$$v_{e}=\left(\frac{2GM}{R}\frac{R}{R}\right)^{0.5}=\left(2\frac{GM}{R^2}R\right)^{0.5}=\left(2gR\right)^{0.5}$$
A: The problem is solved when you realize that $g$ in your second formula is a function of $R$: if
$$F = \frac{GMm}{r^2}$$
is rewritten as
$$F = mg$$
Then it follows that
$$g = \frac{GM}{r^2}$$
When you substitute that in your second equation, you get the first...
