Time and distance averages of speed (source code)

= Time and distance averages of speed
{title2=$V_x-V_t=\operatorname{Var}_t(v)/V_t\geq0$}

For forward motion with nonnegative <speed> $v(t)$ over duration $T>0$ and distance $L=\int_0^Tv(t)\,dt>0$, define the time-averaged <speed> $V_t=L/T$ and distance-averaged <speed> $V_x=L^{-1}\int v\,dx$. The <change of variables> $dx=v\,dt$ gives $V_x=\mathbb E_t[v^2]/\mathbb E_t[v]$, where $\mathbb E_t$ averages uniformly over time. Therefore
$$
V_x-V_t=\frac{\mathbb E_t[v^2]-(\mathbb E_t[v])^2}{\mathbb E_t[v]}=\frac{\operatorname{Var}_t(v)}{V_t}\geq0.
$$
Equality holds exactly for constant <speed> almost everywhere. This also follows directly from the <Cauchy-Schwarz inequality> applied to $v$ and one on the time interval. The reason for the difference is that distance averaging puts more weight on periods when the vehicle covers more distance per unit time. These formulas assume a finite second time moment; if that moment is infinite, the distance average is infinite and the inequality holds in the extended sense.