Virial Theorem dilema

Home Simulators

In class we learned that the total energy of a two-body system was given by the following:

$$E=-\frac{k}{2a}\text{, where $a$ is the semi-major axis}$$

When I saw this, I figured that this result followed from the virial theorem based on how it looks vaguely like the half-potential.

The following is taken from the virial theorem wikipedia page:

For gravitational attraction, n equals −1 and the average kinetic energy equals half of the average negative potential energy:

$$\langle T\rangle_\tau=-\frac12\langle V_\text{TOT}\rangle_\tau.$$

However consider instead this application of the Virial theorem:

The energy is constant, so the energy equals the average energy.

$$E=\langle T+V\rangle=\langle T\rangle+\langle V\rangle=\frac12\langle V\rangle=-\frac12\langle\frac{k}{r}\rangle=-\frac k2\langle\frac{1+e\cos\theta}{\alpha}\rangle=-\frac{k}{2\alpha}\left(\langle1\rangle+e\langle\cos\theta\rangle\right)=-\frac{k}{2\alpha}$$
$$\text{Where, here, $\alpha$ is the semi-latus rectum}$$

These two quantities are only equal for circular orbits, so clearly I’m missunderstanding the usage of the Virial theorem. It’s also possible that I’m misusing the chevrons for averages. Maybe I’m using an arithmetic mean but they’re something else?

Any help is appreciated.