Solution (source code)

= Solution

Use $\hbar=1$. Taking the trace of the imaginary-time <time-evolution operator> identifies the initial and final position, giving the <path integral>
$$
\boxed{Z(\beta)=\operatorname{Tr}e^{-\beta H}
=\int_{x(\beta)=x(0)}\mathcal Dx\,
\exp\left[-\int_0^\beta d\tau\left(\frac m2\dot x^2+\frac\kappa2x^2+
\frac\lambda{4!}x^4+\frac\mu{6!}x^6\right)\right].}
$$
The measure includes integration over the common endpoint. The paths are real periodic bosonic paths on the imaginary-time circle, not paths with fixed zero endpoints and not only classical trajectories. The kinetic measure is defined by time slicing; typical contributing paths need not be differentiable. For the free expansion assume $m,\kappa>0$. The interacting <partition function> requires a potential bounded below; otherwise the following formulas have the meaning of a formal <perturbation series> about the free <harmonic oscillator>.