# Green's function For Helmholtz Equation in 1 Dimension

We seek to find $g(x)$ with $x\in \mathbb{R}$ that satisfies $$(k^2 + \partial_x^2)g(x) = \delta(x)$$ Based on what I obtain in reference material, we try the following $$q(x) = e^{-ik|x|}$$ $$\partial_x q(x) = -ikq(x)\partial_x |x|$$ $$\partial_x^2 q(x) = -k^2q(x)(\partial_x |x|)^2 -ikq(x)\partial^2_x|x|$$ We might be tempted to now claim $(\partial_x |x|)^2 = 1$ and $\partial^2_x|x| = 2\delta(x)$ and get \begin{align*}\partial_x^2 q(x) &= -k^2q(x) -2ikq(x)\delta(x) \\&\to -k^2q(x) -2ik\delta(x) \;\;\;\;\;\;\;\;.\end{align*} The last part might be done since $q(0) = 1$. But I am not sure these manipulations are on solid ground. Ideally I would like to be able to show this more rigorously in some way, perhaps using the test function method. $$\lim_{\epsilon\to 0}\int_{-\epsilon}^{\epsilon}dx f(x)\left[k^2 +\partial^2_x\right]e^{-ik|x|} =-2ikf(0)$$

Taking the Fourier transform of both sides, $$(k^2-(2\pi \omega)^2) \tilde{g}(\omega) = 1,$$ so $$\tilde{g}(\omega) = \frac{1}{k^2-(2\pi \omega)^2} = \frac{1}{2k}\left(\frac{1}{2\pi \omega-k}-\frac{1}{2\pi \omega+k} \right)$$ At this point we have a problem: the fractions have poles on the real axis. And now you have to make a choice: the way in which you choose to evaluate the inverse transform will give you different options for the Green's function.
In particular, you can shift the poles off the real axis by adding a small imaginary part to the denominators: the signs of these determine what sort of Green's function you get. It's very similar to the retarded, advanced and Feynman propagators in QFT. Passing over the actual calculation (which is just the usual contour integration and Jordan's lemma argument), we obtain the following possible solutions: $$G_r(x) = \begin{cases} -\frac{1}{k}\sin{kx} & x<0 \\ 0 & x \geqslant 0 \end{cases} \\ G_a(x) = \begin{cases} 0 & x < 0 \\ \frac{1}{k}\sin{kx} & x \geqslant 0 \end{cases} \\ G_f(x) = \begin{cases} \frac{1}{2ik}e^{-ikx} & x<0 \\ \frac{1}{2ik}e^{ikx} & x \geqslant 0 \end{cases}$$
You can check that all of these are continuous at $0$, and satisfy the jump condition found by integrating the equation over the delta: $$[\partial_x g(x)]_{0-}^{0+} = 1.$$ They act in the same way as the retarded, advanced and Feynman propagators do in QFT: the first is causal/only stuff to the left of $x$ affects it, the second is anticausal (?), and the third is a weird mixture.