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.