Solution (source code)

= Solution

Let $r_0$ be the separation of the two centres at release. The <two-body problem> has relative <specific orbital energy> $\varepsilon=v^2/2-G(M_p+M)/r$. Marginal escape has $\varepsilon=0$, so
$$
\boxed{v_{\rm esc}(r_0)=\sqrt{\frac{2G(M_p+M)}{r_0}}\simeq\sqrt{\frac{2GM_p}{r_0}}}.
$$
This follows equally by equating the relative <kinetic energy> $\tfrac12m_{\rm red}v^2$ to the magnitude of the <Newtonian gravitational potential energy> $GM_pM/r_0$, where $m_{\rm red}=MM_p/(M+M_p)$.

For a pointlike <comet> released at the <planet>'s surface, $r_0=R_p$, giving the usual $\boxed{v_{\rm esc}=\sqrt{2GM_p/R_p}}$. If the finite <comet> touches that surface, its centre is at $r_0=R_p+R$; the same formula uses this larger separation. The assumption $M_p\gg M$ by itself does not imply $R\ll R_p$. Subsequent formulas written in terms of the planet-only <escape velocity> use the additional small-comet approximation.

This is local escape from an isolated <planet>. In a stellar <Newtonian gravitational field>, reaching the edge of the <Hill sphere> and escaping the stellar system are different <energy> thresholds.