Fourier transform of Hamiltonian for scalar field In the Srednicki notes (http://web.physics.ucsb.edu/~mark/ms-qft-DRAFT.pdf) page 36 he goes from
$$H = \int d^{3}x a^{\dagger}(x)\left( \frac{- \nabla^{2}}{2m}\right) a(x) $$ to 
$$H = \int d^{3}p\frac{1}{2m}P^{2}\tilde{a}^{\dagger}(p)\tilde{a}(p) $$
Where $$\tilde{a}(p) = \int \frac{d^{3}x}{(2\pi)^{\frac{3}{2}}}e^{-ipx}a(x)$$
I tried doing this by saying
$$H = \int d^{3}x \int \frac{d^{3}p}{(2\pi)^{3}}e^{-ipx} \tilde{a}^{\dagger}(p) \left(\frac{P^{2}}{2m}\right)e^{ipx}\tilde{a}(p) $$
But then I'm unsure how to proceed with commutators. Does $P^{2}$ commute with $e^{ipx}$? What about with $\tilde{a}(p)$?
Any help would be greatly appreciated.
 A: Starting from
$$
H = \int d^{3}x a^{\dagger}(x)\left( \frac{- \nabla^{2}}{2m}\right) a(x)
$$
and
$${a}(x) = \int \frac{d^{3}p}{(2\pi)^{\frac{3}{2}}}e^{ipx}\tilde{a}(p)$$
(the second of which follows by inverting the expression above which defines the momentum space $a$ in terms of the position space $a$.
Plugging in for both operators, we have
\begin{align*}
H &= \int d^{3}x a^{\dagger}(x)\left( \frac{- \nabla^{2}}{2m}\right) a(x)\\
&=\int d^{3}x
\int \frac{d^{3}p'}{(2\pi)^{\frac{3}{2}}}e^{ip'x}\tilde{a}^{\dagger}(p')
\left( \frac{- \nabla^{2}}{2m}\right)
\int \frac{d^{3}p}{(2\pi)^{\frac{3}{2}}}e^{ipx}\tilde{a}(p)\\
&=
\int d^{3}p'\int d^{3}p\tilde{a}^{\dagger}(p')\tilde{a}(p)
\int \frac{d^{3}x}{(2\pi)^3}
e^{ip'x}\left( \frac{- \nabla^{2}}{2m}\right)e^{ipx}
\end{align*}
after some rearranging. Then, taking the derivatives, this becomes
\begin{align*}
H 
&=
\int d^{3}p'\int d^{3}p\tilde{a}^{\dagger}(p')\tilde{a}(p)
\int \frac{d^{3}x}{(2\pi)^3}
e^{ip'x}\left( \frac{p^2}{2m}\right)e^{ipx}
\end{align*}
which we can rearrange as
\begin{align*}
H 
&=
\int d^{3}p'\int d^{3}p\frac{p^2}{2m}\tilde{a}^{\dagger}(p')\tilde{a}(p)
\int \frac{d^{3}x}{(2\pi)^3}e^{ip'x}e^{ipx}.
\end{align*}
Recognizing the last integral as a representation of a delta function and then evaluating the integral over the primed momentum coordinates gives us our result:
\begin{align*}
H 
&=
\int d^{3}p'\int d^{3}p\frac{p^2}{2m}\tilde{a}^{\dagger}(p')\tilde{a}(p)
\delta^{(3)}(p-p')\\
&=
\int d^{3}p\frac{p^2}{2m}\tilde{a}^{\dagger}(p)\tilde{a}(p).
\end{align*}
A: Srednicki goes from
$$
H = \int d^{3}x\ a^{\dagger}(x)\left( \frac{- \nabla^{2}}{2m}\right) a(x)
$$
to
$$
H = \int d^{3}p\ \frac{1}{2m}p^{2}\ \tilde{a}^{\dagger}(p)\tilde{a}(p)
$$
where $p^2$ is just a number (an integration variable, not an operator). Therefore, it commutes with everything.
