We present a Green's-function method for the evaluation of the particle density profile and of the higher moments of the one-body density matrix in mesoscopic systems containing a large number N of Fermi particles moving independently on a line under an external potential. The usefulness of the method is illustrated by applications to a Fermi gas confined in a harmonic potential well, for which we evaluate the momentum flux density, entering the equations of generalized hydrodynamics, and the kinetic energy density, which is relevant to the density-functional theory. As a further application of the method we explicitly display the quantum mean square fluctuations of these quantities. We also study some properties of the kinetic energy functional
Ekin[n(x)] in the same system. Whereas a local approximation to the kinetic energy density is demonstrably wrong, an exact single-valued relationship between the density derivative of
Ekin[n(x)] and the particle density
n(x) is demonstrated and evaluated for various values of the number of particles in the system.