The virial theorem relates average kinetic energy to the forces acting on a system. Its essential qualification is an endpoint term: an average time derivative does not vanish merely because we call it an average.
The finite-time identity
Consider particles with constant masses , positions , and velocities in an inertial frame. Assume Newton's equations hold on the interval under consideration. Define
Differentiating gives
For , let . Integration yields the exact identity
The right side is zero over a period for which . It tends to zero in a long-time limit if ; bounded positions and velocities are one sufficient condition. If the relevant averages also converge, the usual virial theorem follows:
An escaping particle need not satisfy these conditions. For free motion with nonzero velocity, grows linearly, so dropping the endpoint term would incorrectly imply zero kinetic energy.
A homogeneous potential
Suppose the forces derive from a differentiable total potential , so . This formulation includes interactions between particles; we need not pretend each particle has an independent potential.
Assume simultaneous scaling gives
where the potential is defined. Differentiate with respect to at :
Under the averaging conditions above, substitution gives
The potential's additive constant is fixed by the homogeneity condition. Adding an arbitrary constant usually destroys that condition, even though it leaves the forces unchanged.
Two examples
For a bound, collision-free Kepler orbit, is homogeneous of degree . Thus . If is constant, then and .
For a harmonic oscillator, has degree , so over a period. Instantaneous kinetic and potential energy generally differ; the equality concerns their averages.