The potential energy of a one-dimensional harmonic potential can be expressed as $U(x)=\frac{1}{2}K(x-x_0)^2$, where $K$ is the force constant and $x_0$ is the equilibrium position. I'm wondering how one can calculate its (1) free energy and (2) free energy profile along $x$.
I first calculated the partition function as $Z=\int^{+\infty}_{-\infty}\exp\left (-\frac{1}{2}\beta K (x-x_0)^2\right)dx=\sqrt{\frac{2 \pi}{\beta K}}$, where $\beta=1/k_B T$ is the inverse temperature. Then, I calculated the free energy as $F=-\frac{1}{\beta}\ln Z=-\frac{1}{\beta}\ln\left ( \sqrt{\frac{2\pi}{\beta K}} \right)$ While I'm relatively confident that the problem-solving logic is correct, I don't really understand the what this free energy represents. Compared to this, a free energy profile makes much more sense to me as it tells us which region in the space of $x$ has lower energy and is therefore more probable.
At the same time, I'm not entirely sure what the free energy profile should look like. By definition, the free energy profile can be obtained by taking the negative logarithm (with a multiplying factor of $\beta^{-1}$ of course) of a partially integrated partition function obtained by integrating $\exp(U({\bf x}))$ over all variables except for the variable along which we want to plot the free energy profile. However, in this case, $x$ is the only degree of freedom, so I assume that no integration needs to be carried out, namely, the free energy profile along $x$ should be simply $$F(x)=-\frac{1}{\beta}\ln\left(\exp(U(x))\right)=-\frac{1}{\beta}U(x)=-\frac{K}{2\beta}(x-x_0)^2 $$ However, this looks weird to me.
Also, I sometimes saw that people calculate the free energy profile as $F(x) = -\frac{1}{\beta}\ln P(x)$, but I'm not sure if this is correct or if I should use this formula in this situation. I guess I'm confused when to use $F(x) = -\frac{1}{\beta}\ln Z(x)$ and when to use $F(x) = -\frac{1}{\beta}\ln P(x)$.
Please correct me if I have any misunderstanding. Thanks in advance!