Solution (source code)

= Solution

Promote the <mode expansion of a free field> coefficients to <annihilation operators> and <creation operators>, replacing $a^*$ by $a^\dagger$. The <canonical commutation relations> are
$$
\boxed{[a_{\mathbf p},a_{\mathbf q}^\dagger]=(2\pi)^3\delta^3(\mathbf p-\mathbf q),\qquad
[a_{\mathbf p},a_{\mathbf q}]=[a_{\mathbf p}^\dagger,a_{\mathbf q}^\dagger]=0.}
$$
Together with the normalization in part a, they give $[\phi(t,\mathbf x),\pi(t,\mathbf y)]=i\delta^3(\mathbf x-\mathbf y)$ and vanishing equal-time <commutators> between two <fields> or two <conjugate momenta>.

Insert the <mode expansion of a free field> in the <Hamiltonian>. The spatial integral produces $(2\pi)^3\delta^3(\mathbf p\pm\mathbf q)$. The $aa$ and $a^\dagger a^\dagger$ coefficients cancel because $\omega_{\mathbf p}^2=\mathbf p^2+m^2$. The remaining terms give
$$
H=\frac12\int\frac{d^3p}{(2\pi)^3}\omega_{\mathbf p}
\left(a_{\mathbf p}^\dagger a_{\mathbf p}+a_{\mathbf p}a_{\mathbf p}^\dagger\right)
=\int\frac{d^3p}{(2\pi)^3}\omega_{\mathbf p}a_{\mathbf p}^\dagger a_{\mathbf p}
+\frac{(2\pi)^3\delta^3(0)}2\int\frac{d^3p}{(2\pi)^3}\omega_{\mathbf p}.
$$
This is a continuum of <quantum harmonic oscillators>. In a finite periodic volume $V$, $(2\pi)^3\delta^3(0)=V$. The <Fock vacuum> satisfies $a_{\mathbf p}|0\rangle=0$, so its <vacuum energy density> is
$$
\boxed{\mathcal E=\frac{\langle0|H|0\rangle}{V}=\frac12\int\frac{d^3p}{(2\pi)^3}\sqrt{\mathbf p^2+m^2}.}
$$
<Normal ordering> would subtract this constant; here it must be retained because it is the quantity being calculated.<Quantum Field Theory by David Tong>[Section 2, canonical quantization of the real scalar field and its zero-point Hamiltonian]{ref}