Solution (source code)

= Solution

In a planetary <gravitational assist>, the incoming and outgoing relative speeds have the same magnitude. If $\mathbf u$ is the planet-frame velocity, the heliocentric <specific orbital energy> change is consequently
$$
\Delta\varepsilon=\mathbf v_p\cdot\Delta\mathbf u,
$$
not an arbitrary addition of $|\Delta\mathbf u|$ to the heliocentric speed. The initial binding energy per unit mass is $GM_\star/(Q+q)\simeq GM_\star/Q$.

For a weak deflection, $b\gg b_{90}=GM_p/v_\infty^2$, the hyperbolic scattering formula gives $|\Delta\mathbf u|\simeq2GM_p/(bv_\infty)$. Its direction is perpendicular to the incoming relative velocity. At the <planet>, in the near-parabolic prograde limit,
$$
u_r\simeq\pm v_p\sqrt{2(1-s)},\qquad u_t\simeq v_p(\sqrt{2s}-1),\qquad
v_\infty=\gamma v_p,\qquad \kappa=\frac{|u_r|}{v_\infty}=\frac{\sqrt{2(1-s)}}\gamma.
$$
On the favorable side of the <planet> the energy gain is approximately $2GM_pv_p\kappa/(bv_\infty)$. Equating this to the binding energy gives the ejection <impact parameter>
$$
\boxed{b_{\rm ej}\simeq2\frac{M_p}{M_\star}\frac\kappa\gamma Q\propto Q.}
$$
Only one sign of impact parameter gains energy for each radial branch. Noncolliding ejections have $R_p<|b|<b_{\rm ej}$, giving width $(b_{\rm ej}-R_p)_+$, where $x_+=\max(x,0)$. For $b_{\rm ej}\gg R_p$, the <planetary ejection of a comet> rate is approximately $\Gamma_{\rm ej}=\Sigma_c v_\infty b_{\rm ej}$. With $\mu_p=M_p/M_\star$ this gives
$$
\boxed{t_{\rm ej}\simeq\frac{\pi^2a_p\sqrt{1-s}}{2\mu_p\kappa\sqrt{GM_\star}}\,Q^{1/2}\propto Q^{1/2}.}
$$
The scaling applies when $b_{90}\ll b_{\rm ej}\ll r_H$ so that the local two-body encounter and weak-deflection approximations are consistent. The favorable-side coefficient assumes a coplanar orbit; averaging over other encounter geometries changes it. Cumulative diffusion by many subthreshold encounters is not included in this one-encounter estimate.