We have recently employed periodic Anderson model with electron-phonon interactions to describe Cerium volume collapse (γ → α transition) under pressure. To describe the volume collapse transition in Cerium, we have tried to plot the pressure versus volume curves and see when a kink structure emerges. One way to obtain the pressure versus volume curve is to calculate the total energy of the system at different temperatures. In order to solve the periodic Anderson model with electron-phonon interactions, we have used the continuous time quantum Monte Carlo algorithm by integrating out the phonons to obtain a retarded electron-electron interaction. Monte Carlo simulation results give us the model's electronic Green function and self energy, from which we can calculate the system's total energy. A well known formula for calculating total energy through the knowledge of electron's self energy and Green function is derived from the model's Hamiltonian, which is not available for our case. Here, we have devised a new method to derive the total energy formula purely from a path integral description of the system, without resort to its Hamiltonian formulation. Since not all systems can be described by a Hamiltonian, thus our method has a wider applicability. It is noteworthy that the total energy formula that we derived here takes an identical form with that obtained from a model's Hamiltonian.