Solution (source code)

= Solution

The transverse <velocity> is $v_\theta=h/r$. Subtracting its square from the <vis-viva equation>, and putting $u=a/r$, gives
$$
\dot r^2=\mu\left(\frac2r-\frac1a\right)-\frac{\mu a(1-e^2)}{r^2}
=\frac{\mu}{a}\left[2u-1-u^2(1-e^2)\right].
$$
Consequently
$$
\boxed{\dot r=\pm v_k(a)\sqrt{2u-1-u^2(1-e^2)}}.
$$
The positive branch is outward motion and the negative branch is inward motion. The PDF's unsigned expression gives the radial speed, or the outward branch, rather than the signed radial <velocity> everywhere. For example, on the inward part of any noncircular <elliptic orbit>, $\dot r<0$.

The same result follows from $\dot r=(\mu e/h)\sin f$, with $f$ the <true anomaly>. The radicand is nonnegative precisely on $1/(1+e)\leq u\leq1/(1-e)$; it vanishes at <periapsis> and <apoapsis>. For a <circular Kepler orbit>, $e=0$, $u=1$ and $\dot r=0$.