In my lecture on quantum field theory, we have recently discussed the canonical quantisation of a scalar field. There is one particular calculation, that I do not quite understand.
Namely, we have the following Fourier integral: $$\Phi(x)=\int\frac{d^4p}{(2\pi)^3}\left(\delta(p_0-E)+\delta(p_0+E)\right)e^{-ipx},$$ where $x$, $p$ are 4-vectors, i.e. $xp=x_0p^0-\vec{x}\vec{p}$.
My professor said that in the first summand the integration can be carried out regularly, while in the second, one has to make the substitution $p\mapsto-p$, giving us: $$\Phi(x)=\int\frac{d^3\vec{p}}{(2\pi)^3}\left(e^{-ipx}+e^{ipx}\right)|_{p_0=E}.$$
Note that I have simplified the integral a bit, so it may not make much sense in a physical sense. Anyway, I have tried to make sense of this mathematically on my own.
For completeness, the first summand is: $$\int\frac{d^3\vec{p}}{(2\pi)^3}\int dp_0\delta(p_0-E)e^{-ip_0x_0}e^{i\vec{x}\vec{p}} =\int\frac{d^3\vec{p}}{(2\pi)^3}e^{-iEx_0}e^{i\vec{x}\vec{p}} =\int\frac{d^3\vec{p}}{(2\pi)^3}e^{-ixp}|_{p_0=E}.$$
However, I do not know what he did in the second summand. I come up with the following calculation. First, I substitute $p:=-k$. This entails $dp_0=-dk_0$ and $d^3\vec{p}=-d^3\vec{k}$. Both signs cancel and we are left with: $$\int\frac{d^3\vec{k}}{(2\pi)^3}\int dk_0\delta(E-k_0)e^{ik_0x_0}e^{-i\vec{x}\vec{p}} =\int\frac{d^3\vec{k}}{(2\pi)^3}e^{iEx_0}e^{-i\vec{x}\vec{k}} =\int\frac{d^3\vec{k}}{(2\pi)^3}e^{ixk}|_{k_0=E}.$$
Now, I can see how simply renaming $k:=p$ leaves us with the expression from his lecture. However, $p$, $k$ are not independent anymore, since we subsituted $k=-p$ and thus $d^3\vec{p}=-d^3\vec{k}$. Resubstitution gives us a different sign in the second summand: $$\Phi(x)=\int\frac{d^3\vec{p}}{(2\pi)^3}\left(e^{-ipx}-e^{ipx}\right)|_{p_0=E}.$$
So either I have made a mistake somewhere or he took some ominous shortcut (which is unfortunately somewhat typical for QFT introductions).
Someone enlighten me please?
So, it turns out that you can indeed split the integral in two, then make the substitution, then switch the limits, then rename the integration variable in the second integral because its integration can be carried out independent of the first one:
$$\int^\infty_{-\infty} f(x)dx=-\int^{-\infty}_\infty f(-y)dy=\int^\infty_{-\infty} f(-y)dy\mapsto \int^\infty_{-\infty} f(-x)dx.$$