Contour for integration in 1D scattering problem A plane wave scattered by a 1D potential can be described by,
$$\psi(x) = \begin{cases}
e^{ikx} + R e^{-ikx}, & x<0\\
T e^{ikx}, & x>0
\end{cases}$$
where $R$ is the reflection amplitude and $T$ is the transmission amplitude. Now to figure out $R$ and $T$, it is a standard approach to make a Fourier transform and solve the problem in the momentum space to obtain $\tilde\psi(p)$ and inverse Fourier transform it to get $\psi(x)$. From that expression one can get the reflection amplitude $R$ by comparing it to the above equation.
Now my question is following. While trying to find the inverse Fourier transform in order to find $R$, one encounters the following integral,
$$\begin{equation}
\int_{-\infty}^{\infty} \frac{e^{ipx}}{p^2-k^2} \frac{dp}{2\pi}
\end{equation}
$$
where $k$ is the free wave vector. As one can see, the poles are on the real axis and need to be shifted. My question is how to choose the contour for the above integration, i.e., how do I know which way to shift the poles to get the right physical picture?
 A: The choice is made so as to give outgoing reflected and transmitted waves. Taking $k>0$ so that the incident wave is travelling towards positive $x$, this means that the solution for $x>0$ should be $\propto\exp(ikx)$ and the solution for $x<0$ should be $\propto\exp(-ikx)$, as you have in your first equation.
The choice which gives this is to displace the pole at $p=+k$ upwards a little, to $+k+i\epsilon$, and the pole at $p=-k$ downwards a little, to $-k-i\epsilon$. Having seen what happens in this case, it is easy to deduce the other cases, since they just correspond to different combinations of the two residues.
For $x>0$ the contour must be closed in the upper half plane of $p$, because the contribution from the upper semicircle vanishes. (The exponential in the numerator means that you can't close the contour in the lower half plane). In this case, the integration will not encircle the pole at $p=-k-i\epsilon$, but will catch the contribution from the residue at $p=+k+i\epsilon$, which gives something proportional to $\exp(ikx)$. For $x<0$ the contour must be closed in the lower half plane, again because the lower semicircle gives zero contribution. Obviously, care must be taken with the signs (clockwise integration) but the main point is that the contour will encircle the pole at $p=-k-i\epsilon$, picking up the residue which is proportional to $\exp(-ikx)$, but will not encircle the other pole. These are the outgoing solutions we want.
If the poles are displaced in the opposite directions to the above, the solutions will correspond to incoming waves: $\exp(-ikx)$ for $x>0$ and $\exp(+ikx)$ for $x<0$. Those solutions are not physical. If the poles are both displaced in the same direction (upwards or downwards), then the contour integral for one of the cases of positive or negative $x$ will give zero, while the other will enclose both poles giving something proportional to $\sin kx$. We don't want those solutions either.
A: $\let\a=\alpha \let\b=\beta \let\d=\delta \let\eps=\varepsilon\def\tpsi{\tilde\psi} \def\cP{{\cal P}} \def\sgn{\mathop{\rm sgn}}$
Here is my solution to your problem. Schrödinger equation is
$$-{\hbar^2 \over 2m} \psi'' + V_0\,\d(x)\,\psi = E\,\psi.$$
Fourier transform is
$${\hbar^2 p^2\over 2m}\,\tpsi(p) + V_0\,\psi(0) = 
{\hbar^2 k^2\over 2m}\,\tpsi(p) \qquad 
\left(\!E = {\hbar^2 k^2\over 2m}\quad k>0\right)\!.$$
$$(p^2 - k^2)\,\tpsi(p) + k_0\,\psi(0) = 0 \qquad 
    \left(\!k_0 = {2\,m\,V_0 \over \hbar^2}\right)\!.\tag1$$
Now I assume you wrote
$$\tpsi(p) = -{k_0\,\psi(0) \over p^2 - k^2} \tag2$$
$$\psi(x) = \int\!e^{ipx}\,\tpsi(p)\,{dp \over 2\pi} = 
              -k_0\,\psi(0) \int\!{e^{ipx} \over p^2 - k^2}\,{dp \over 2\pi}.\tag3$$
The subtle point is in passing from (1) to (2). You can't do it so
easily, because of singularities in $p=\pm k$. You have to think in
terms of distributions, and recall $p\,\d(p)=0$. Then instead of (2)
you must write
$$\tpsi(p) + {k_0\,\psi(0) \over p^2 - k^2} = 
    \a\,\d(p-k) + \b\,\d(p+k)$$
where $\a$, $\b$ are hitherto arbitrary complex constants.
Moreover, $1/(p^2 - k^2)$ isn't well defined, for the same reason. Let's write
$${1 \over p^2 - k^2} = {1 \over 2 k}
                           \left({1 \over p - k} - {1 \over p + k}\right)$$
and specify this as
$${1 \over p^2 - k^2} = {1 \over 2 k} \left(\cP\,{1 \over p - k} - 
                                              \cP\,{1 \over p + k}\right)$$
where $\cP$ means principal value and in front of an integral is defined as
$$\cP\!\int_{-\infty}^{+\infty}\!{f(p) \over p - k}\,dp = 
    \lim_{\eps\to0} \int_{-\infty}^{-\eps}\!{f(p) \over p - k}\,dp\, +
                      \int_{+\eps}^{+\infty}\!{f(p) \over p - k}\,dp$$
if $f(p)$ has no poles all over $\Bbb R$. An equivalent form is
$$\int_{-\infty}^{+\infty}\!{f(p) - f(k) \over p - k}\,dp.$$
Then the final form of (3) is
$$\psi(x) = -{k_0 \over 2k}\,\psi(0)
              \left[\cP\!\int\!{e^{ipx} \over p - k}\,{dp \over 2\pi} -
                      \cP\!\int\!{e^{ipx} \over p + k}\,{dp \over 2\pi}\right] + 
              \a\,e^{ikx} + \b\,e^{-ikx} \tag4$$
The integrals in (4) are easily computed via residues:
$$\cP\int\!{e^{ipx} \over p \mp k}\,{dp \over 2\pi} = 
{i \over 2}\,e^{\pm ikx}\,\sgn x$$
and
$$\eqalign{\psi(x) 
    &= -{i\,k_0 \over 4\,k}\,\psi(0) \left(e^{ikx} - e^{-ikx}\right) \sgn x +
         \a\,e^{ikx} + \b\,e^{-ikx} \cr
    &= \left(\!\a - {i\,k_0 \over 4\,k}\,\psi(0)\,\sgn x\!\right)\!e^{ikx} + 
         \left(\!\b + {i\,k_0 \over 4\,k}\,\psi(0)\,\sgn x\!\right)\! 
           e^{-ikx}.\cr} \tag5$$


*

*for $x<0$:
$$\psi(x) = \left(\!\a + {i\,k_0 \over 4\,k}\,\psi(0)\right) e^{ikx} + 
         \left(\!\b - {i\,k_0 \over 4\,k}\,\psi(0)\right)  
           e^{-ikx} \tag6$$

*for $x>0$:
$$\psi(x) = \left(\!\a - {i\,k_0 \over 4\,k}\,\psi(0)\right) e^{ikx} + 
         \left(\!\b + {i\,k_0 \over 4\,k}\,\psi(0)\right)  
           e^{-ikx}.\tag7$$
Then we must choose 
$$\b = -{i\,k_0 \over 4\,k}\,\psi(0)$$
and substituting in (6), (7):


*

*for $x<0$:
$$\psi(x) = \left(\!\a + {i\,k_0 \over 4\,k}\,\psi(0)\!\right)\!e^{ikx} -
         {i\,k_0 \over 2\,k}\,\psi(0)\,e^{-ikx} \tag8$$

*for $x>0$:
$$\psi(x) = \left(\!\a - {i\,k_0 \over 4\,k}\,\psi(0)\!\right)\!e^{ikx}.\tag9$$
From both (8) and (9), for $x=0$ we get
$$\a = \left(\!1 + {i\,k_0 \over 4\,k}\!\right) \psi(0)$$
and finally $\psi(0) = 1$ 


*

*for $x<0$:
$$\psi(x) = \left(\!1 + {i\,k_0 \over 2\,k}\!\right)\!\psi(0)\,e^{ikx} -
         {i\,k_0 \over 2\,k}\,\psi(0)\,e^{-ikx}$$

*for $x>0$:
$$\psi(x) = \psi(0)\,e^{ikx}.$$
It's obvious that we're allowed to multiply $\psi(x)$ for a constant
whatever, perhaps to obey some normalization condition (e.g. unit
incoming flux).
