Prove that
⟨q∣e−βH^∣q′⟩≡exp[−βH^(−iℏ∂q∂,q)]δ(q−q′),
where H^(−iℏ∂/∂q,q) is the Hamiltonian of the system, in the q-representation, which formally operates upon the Dirac delta function δ(q−q′). Writing the δ-function in a suitable form, apply this result to (i) a free particle and (ii) a linear harmonic oscillator.