  We study the statistics of the kinetic (or equivalently potential) energy for
$N$ non-interacting fermions in a $1d$ harmonic trap of frequency $\omega$, at
finite temperature $T$. Remarkably, we find an exact solution for the full
distribution of the kinetic energy, at any temperature $T$ and for any $N$,
using a non-trivial mapping to an integrable Calogero-Moser-Sutherland model.
As a function of temperature $T$, and for large $N$, we identify: (i) a quantum
regime, for $T \sim \hbar \omega$, where quantum fluctuations dominate and (ii)
a thermal regime, for $T \sim N \hbar \omega$, governed by thermal
fluctuations. We show how the mean, the variance as well as the large deviation
function associated with the distribution of the kinetic energy cross over from
the quantum to the thermal regime as temperature increases.
