In Prof. Eduardo Fradkin's lecture, he computed the free energy (up to a divergent normalization constant) of the $(d+1)$-dim free massive scalar theory at finite temperature $T$ as

\begin{align}

F(T) =\frac{VT}{2} \int \frac{d^{d}p}{(2\pi)^{d}}\sum_{n=-\infty}^{\infty}\ln{\beta[\omega_{n}^{2} + |\mathbf{p}|^{2} + m^{2}]}, \text{ (see his Eq. (5.204))}

\end{align}

where $\omega_n = 2\pi n / \beta$ is the Matsubara frequency, $n \in \mathbb{Z}$, $V$ is the volume of the spatial part and $T$ is the finite temperature. This summation is formally divergent. He then mentioned that we can make use of the divergent normalization constant to regularize this summation. My understanding is that we add to $F(T)$ a constant that is also formally divergent:

\begin{align}

F_{reg}(T) = F(T) + A

\end{align}

where $A$ is some constant and $F_{reg}(T)$ is the regularized free energy. And then $F_{reg}(T)$ will no longer be divergent (up to the $VT$ infrared divergence). The result he gave us immediately turns out to be

\begin{align}

F_{reg}(T) = VT \int \frac{d^{d}p}{(2\pi)^{d}}\ln\left[ \left(\beta (|\mathbf{p}|^{2} + m^{2})^{1/2}\right) \prod_{n=1}^{\infty} \left( 1 + \frac{|\mathbf{p}|^{2} + m^{2}}{\omega_n^2} \right) \right]. \text{ (see his Eq. (5.205))}

\end{align}

However, I am not quite sure how to systematically obtain this result. Certainly we can work backward and find

\begin{align}

F(T) & = \frac{VT}{2} \int \frac{d^{d}p}{(2\pi)^{d}} \left( \ln{\beta(|\mathbf{p}|^{2} + m^{2})} + 2\sum_{n=1}^{\infty} \ln{\beta(\omega_n^2 + |\mathbf{p}|^{2} + m^{2})}\right) \\

& = VT\int \frac{d^{d}p}{(2\pi)^{d}} \ln\left[ \left(\beta (|\mathbf{p}|^{2} + m^{2})^{1/2}\right) \prod_{n=1}^{\infty} \left( 1 + \frac{|\mathbf{p}|^{2} + m^{2}}{\omega_n^2} \right) \right] \\

& + VT\int \frac{d^{d}p}{(2\pi)^{d}} \left( - \frac{1}{2}\ln\beta + \sum_{n=1}^{\infty}\ln (\beta \omega_n^2) \right)

\end{align}

And then we choose $A$ in $F_{reg}(T) = F(T) + A$ to be

\begin{align}

A = -VT\int \frac{d^{d}p}{(2\pi)^{d}} \left( - \frac{1}{2}\ln\beta + \sum_{n=1}^{\infty}\ln (\beta \omega_n^2) \right)

\end{align}

such that we obtain

\begin{align}

F_{reg}(T) = VT \int \frac{d^{d}p}{(2\pi)^{d}}\ln\left[ \left(\beta (|\mathbf{p}|^{2} + m^{2})^{1/2}\right) \prod_{n=1}^{\infty} \left( 1 + \frac{|\mathbf{p}|^{2} + m^{2}}{\omega_n^2} \right) \right].

\end{align}

But this is not a systematic way that I am seeking for. Are there any suggestions or reference that carry out this sort of regularization in details? Thanks.