We present a unified formulation for quantum statistical physics based on the representation of the density matrix as a functional integral. We identify the stochastic variable of the effective statistical theory that we derive as a boundary configuration and a zero mode relevant to the discussion of infrared physics. We illustrate our formulation by computing the partition function of an interacting one-dimensional quantum mechanical system at finite temperature from the path-integral representation for the density matrix. The method of calculation provides an alternative to the usual sum over periodic trajectories: it sums over paths with coincident endpoints, and includes non-vanishing boundary terms. An appropriately modified expansion into Matsubara modes provides a natural separation of the zero-mode physics. This feature may be useful in the treatment of infrared divergences that plague the perturbative approach in thermal field theory.