From David Tong's notes: How do we derive $$ H = \int\frac{d^3p}{(2\pi)^3}\omega_p[ a_p^\dagger a_p + \frac{1}2(2\pi)^3\delta^{(3)}\ (0) ] $$ from $$H = \frac{1}2\int d^3x\ [\ \pi^2\ +\ (\nabla\phi)^2 \ +m^2\phi^2 \ ] ~? $$
I've been stuck in these calculations for days, any help would be greatly appreciated!
The notes show that $\pi$ and $\phi$ are used as shown below :
$$ \phi(x)\ = \int \frac{d^3p}{(2\pi)^3}\frac{1}{\sqrt{2\omega_p}} [a_p e^{ipx} - a_p^\dagger e^{-ipx}] $$
$$ \pi(x)\ = \int \frac{d^3p}{(2\pi)^3}\ (-i)\sqrt{\frac{\omega_p}2}\ [a_p e^{ipx} - a_p^\dagger e^{-ipx}] $$
Where p and x are 3D spacial vectors.
Also, what does this teach us about the free scalar field? Whats the underlying message other than the maths? I can't seem to understand it. I've also watched the first 5 lectures of this course (understood a good 20% of what was said).