What is the math that we use to calculate the radial velocity?
With the usual nomenclature:
$G$ = universal gravitational constant
$M$ = mass of primary
$m$ = mass of secondary
$a$ = semi-major axis of the elliptical orbit
$e$ = eccentricity of the elliptical orbit
$\theta$ = true anomaly
$r$ = radius vector (position vector from de focus)
The mathematical expression to calculate the radial velocity is:
$$v_r=\sqrt{\frac{G (M+m)}{a(1-e^2)}} \ \ e \sin \theta$$
And the expression for the velocity component perpendicular to the radius vector is:
$$v_{\theta}=\sqrt{\frac{G (M+m)}{a(1-e^2)}} \ \ (1+e \cos \theta)$$
Naturally, it follows that:
$$v=\sqrt{v_r^2+v_{\theta}^2}$$
That operating can be converted into the familiar expression:
$$v=\sqrt{2 G (M+m)\left ( \frac 1 r - \frac 1{2a} \right )}$$
$$v=\sqrt{2 \mu \left ( \frac 1 r - \frac 1{2a} \right )}$$
Where $\mu=G(M+m)$ is the gravitational parameter.
The mathematics required to detect the maxima and minima of a function consists of calculating the places where the derivative of the function is zero.
The derivative of the radial velocity with respect to the true anomaly is:
$$\frac{dv_r}{d\theta}=\sqrt{\frac{G (M+m)}{a(1-e^2)}} \ \ e \cos \theta=0 \rightarrow \cos \theta =0$$
$$\displaystyle \theta=\frac{\pi}2 \qquad or \qquad \theta=\frac{3\pi}2$$
Which corresponds to the two "semilatus rectus".
$\theta=0 \longrightarrow v_r=0$
$0<\theta <\dfrac{\pi}2 \longrightarrow v_r>0$ increasing positive value
$\theta=\dfrac{\pi}2$ maximum positive value of $v_r$
$\dfrac{\pi}2 <\theta < \pi \longrightarrow v_r>0$ decreasing positive value
$\theta=\pi \longrightarrow v_r=0$
$\pi<\theta <\dfrac{3\pi}2 \longrightarrow v_r<0$ increasing module of negative value
$\theta=\dfrac{3\pi}2$ maximum module of the negative value of $v_r$
$\dfrac{3\pi}2<\theta < 2\pi \longrightarrow v_r<0$ dencreasing module of negative value
$\theta=2\pi \longrightarrow v_r=0$ And we have made a complete turn
I attach, as an example, a table with the radial velocity, the perpendicular velocity and the total velocity (metres per second) of the Earth in its elliptical orbit around the Sun, as a function of the true anomaly (radians)
Best regards 521