  We present the first experimental measurement of the ensemble averages of
both the kinetic and interaction energies of the three-dimensional
Bose--Hubbard model at finite temperature and various optical lattice depths
across weakly to strongly interacting regimes, for an almost unit filling
factor. The kinetic energy is obtained through Fourier transformation of a
time-of-flight signal, and the interaction energy is measured using a newly
developed atom-number-projection spectroscopy technique, by exploiting an
ultra-narrow optical transition of two-electron atoms. The obtained
experimental results can be used as benchmarks for state-of-the-art numerical
methods of quantum many-body theory. As an illustrative example, we compare the
measured energies with numerical calculations involving the Gutzwiller and
cluster-Gutzwiller approximations, assuming realistic trap potentials and
particle numbers at nonzero entropy (finite temperature); we obtain good
agreement without fitting parameters. We also discuss the possible application
of this method to temperature estimations for atoms in optical lattices using
the thermodynamic relation. This study offers a unique advantage of cold atom
system for `quantum simulators', because, to the best of our knowledge, it is
the first experimental determination of both the kinetic and interaction
energies of quantum many-body system.
