I'm trying to find the expression for the retarded green function of the d'Alembertian operator, but I'm facing one issue regarding the limits of an integral. Here is my derivation so far:
I started with the definition of the green function of the d'Alembertian:
$$\Box G(x,x^\prime) = \delta^4(x-x^\prime)\tag{ 1}$$
Then, applying a Fourier Transform to equation (1), I found $$\tilde{G}(k) = \frac{1}{w^2 - k^2}\tag{2}$$
which yields $$G(x,x^\prime) = \frac{1}{(2\pi)^4}\int\frac{e^{iw(t-t^\prime)}}{w^2 - k^2} dw\int e^{-iw\vec{k}\cdot{}(\vec{x}-\vec{x}^\prime)} d^3k.\tag{3}$$
The expression in equation (3) has 2 poles, which can be dealt with using the residue theorem and complex analysis, which also allows us to enforce the retarded boundary condition. After some calculations, I found that: $$G(x,x^\prime) = -\frac{1}{2(2\pi)^2 r} \int_{0}^{+\infty} \left(e^{ik\Delta t}e^{-ikr}-e^{ik\Delta t}e^{ikr}-e^{-ik\Delta t}e^{-ikr}+e^{-ik\Delta t}e^{ikr}\right) dk\text{ (4)}$$
where I have adopted $$r \equiv |\vec{x}-\vec{x}^\prime|$$ $$\Delta t \equiv t - t^\prime$$
to make the notation cleaner. All the numerical factors in front of the integral on equation (4) are just right, the issue I'm facing lies in the limits: I know this integral will give rise to Dirac's deltas, which then lead to the final result, but for this to happen the limits must be $[-\infty,+\infty]$ and not $[0,+\infty]$. I found one reference that states this:
The first line of the integral on the image is precisely what I found, but I'm not able to figure out the reasoning between the first and second lines. I found a post from 6 years ago about this same issue, but the only comment there is not helpful.
I appreciate any light shed on this issue.