User:Nr4ps/sandbox

Derivation
It follows from conservation of energy that this quantity is constant throughout the orbit and it remains only to determine this constant. Using the subscripts a and p to denote apoapsis (apogee) and periapsis (perigee), respectively,
 * $$ \epsilon = \frac{v_a^2}{2} - \frac{G(M\!+\!m)}{r_a} = \frac{v_p^2}{2} - \frac{G(M\!+\!m)}{r_p} $$

Rearranging,


 * $$ \frac{v_a^2}{2} - \frac{v_p^2}{2} = \frac{G(M\!+\!m)}{r_a} - \frac{G(M\!+\!m)}{r_p} $$

Conservation of angular momentum requires $$ h = r_pv_p = r_av_a = const$$, thus $$v_p = \frac{r_a}{r_p}v_a$$:


 * $$ \frac{1}{2}(1-\frac{r_a^2}{r_p^2})v_a^2 = \frac{G(M\!+\!m)}{r_a} - \frac{G(M\!+\!m)}{r_p} $$


 * $$ \frac{1}{2}(\frac{r_p^2 - r_a^2}{r_p^2})v_a^2 = \frac{G(M\!+\!m)}{r_a} - \frac{G(M\!+\!m)}{r_p} $$

Isolating the kinetic energy at apoapsis and simplifying,


 * $$ \frac{1}{2}v_a^2 = \left( \frac{G(M\!+\!m)}{r_a} - \frac{G(M\!+\!m)}{r_p}\right) \left( \frac{r_p^2}{r_p^2-r_a^2} \right) $$


 * $$ \frac{1}{2}v_a^2 = G(M\!+\!m) \left( \frac{r_p - r_a}{r_ar_p} \right) \left( \frac{r_p^2}{r_p^2-r_a^2} \right) $$


 * $$ \frac{1}{2}v_a^2 = G(M\!+\!m) \left( \frac{r_p}{r_a(r_p+r_a)} \right) $$

From the geometry of an ellipse, $$2a=r_p+r_a$$ where a is the length of the semimajor axis. Thus,


 * $$ \frac{1}{2}v_a^2 = G(M\!+\!m) \left( \frac{2a-r_a}{r_a(2a)} \right) $$

Substituting this into our original expression for specific orbital energy,


 * $$ \epsilon = \frac{v_a^2}{2} - \frac{G(M\!+\!m)}{r_a} =G(M\!+\!m) \left( \frac{2a-r_a}{2ar_a)} \right) - \frac{G(M\!+\!m)}{r_a} $$


 * $$ \epsilon = G(M\!+\!m) \left( \frac{2a-r_a}{2ar_a} - \frac{1}{r_a} \right) = - \frac{G(M\!+\!m)}{2a} $$

Thus, $$ \epsilon = - \frac{G(M\!+\!m)}{2a} $$ or $$ E = - \frac{G(M\!+\!m)}{2a} $$

For elliptic and circular orbits, it can be shown that the specific orbital
 * $$ \epsilon = \frac{ -G(M\!+\!m)}{2 a} $$

Equating the two previous expressions and solving for v yields the vis viva equation:
 * $$ v^2 = G(M\!+\!m) \left( \frac{2}{r} - \frac{1}{a} \right). $$