Previous page: What is the partition function of a classical harmonic oscillator? Whenever I see the partition function of a classical two-particle oscillator,

$$Z(\beta) \, = \, \int dx \int dp ~ e^{-\beta H(x,p)} \, = \, \int dx ~ e^{-\beta k x^2} \int dp ~ e^{-\beta \frac{p^2}{2m}},$$

the $x$ and $p$ integration limits go from $(-\infty,\infty)$. I assume that these limits come from the approximation that the energy of the system can continuously range from $[0,\infty)$.

But I'm wondering if that's the whole story. Since

$E \, = \, \frac{p^2}{2m} + kx^2 \, = \, \mathrm{constant}$,

we find that $x$ and $p$ actually depend on each other. We can see this more easily when I rewrite the equation as

$x \, \rightarrow \, x(p) \, = \, \pm \, \sqrt{\frac{1}{k}\left[E - \frac{p^2}{2m}\right]}$ or ${p \, \rightarrow \, p(x) \, = \, \pm \, \sqrt{2m\left[E - k x^{2}\right]}}$.

Note that when $p = 0$ we get the maximum $x$ limits $x_{max} \, = \, \pm \, \sqrt{E/k}$.

Instead of independent infinite integration limits, shouldn't we use these instead:

$Z(\beta) \, = \, \int_{-x_{max}}^{+x_{max}} dx \int_{-p(x)}^{+p(x)} dp ~ e^{-\beta k x^2} ~ e^{-\beta \frac{p^2}{2m}}$?

I used these limits when calculating the average energy. The result is more complicated, of course, compared to the average energy calculated using the infinite limits. As $x_{max} \rightarrow \infty$, the average energy using the dependent limits approaches the average energy using the infinite integrals.

Is there a reason why we don't use dependent limits?

  • $\begingroup$ You're missing a factor of 1/2 in the potential energy term $k x^2$. Also, where are the two particles here? This looks like the partition function for a single harmonic oscillator. $\endgroup$
    – tparker
    Commented Dec 25, 2023 at 3:15
  • $\begingroup$ Yes, I didn't include the factor of 1/2, which I believe is standard. It doesn't change the results of this question. It is a simple harmonic oscillator, which can be viewed in a number of ways, including two particles on a spring or two atoms in a molecule. $\endgroup$
    – NickElias
    Commented Dec 25, 2023 at 5:05

1 Answer 1


The dependence of p on x (or the other way around) only comes from the condition of constant energy. This is a natural condition for a microcanonical ensemble, but it is wrong in the canonical ensemble. Remember that the canonical ensemble corresponds to the physical situation of a system (the harmonic oscillator) in contact with a thermostat at a fixed temperature $T$. Under such a condition, the oscillator's energy fluctuates, and every possible value of the energy is allowed (although with different probability). As a consequence, there is no relation between position and momentum, and integrations are over the unrestricted phase space.

  • $\begingroup$ Excellent. Very clear and concise. Thanks. BTW, I wouldn't have thought about using dependent limits for a many-particle system because all of the interactions would make setting it up impossible. I guess the difference between a microcanonical and canonical ensemble still holds even for two particles. $\endgroup$
    – NickElias
    Commented Dec 24, 2023 at 19:21
  • $\begingroup$ @NickElias I agree that the difference between a microcanonical and canonical ensemble still holds even for two particles. $\endgroup$ Commented Dec 25, 2023 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.