Integral of $\int_{-\infty}^{\infty} \frac {dk}{ik+1}$ I came across this integral today in the context of inverse fourier transforms:
$$ R(x)={1 \over 2\pi}\int_{-\infty}^{\infty} \frac {e^{ik(x-1)}}{ik+1}dk$$
I know the solution is supposed to be
$$ R(x) = \theta(x-1)e^{-(x-1)} $$
Where $\theta(x)$ is the Heaviside step function.
I have worked out the integral with contour integration and residual theorem for $x \gt 1$ and $x \lt 1$, wich work out as $e^{-(x-1)}$ and $0$ respectively.
My problem is for $x=0$, where I expect to be $R(0)={1 \over 2}$. The integral would then be:
$$R(0)={1 \over 2\pi}\int_{-\infty}^{\infty} \frac {dk}{ik+1}$$
Wich i don't know how to calculate. Wolfram alpha tells me that the integral is in fact ${1\over2}$.
My first instinct was to multiply and divide the integrand by $e^{ik}$ and then solve the integral by closing the contour and using the residual theorem; but the residual is $-i$, so it would be  $R(0) = 1$.
I know there are different definitions of the Heaviside function, and in some $\theta(0) =1$, but we used $\theta(0) ={1 \over 2}$ the whole course so I find it improbable my professor would use it differently here. Also, Wolfram seems to agree that it should be ${1 \over 2}$.
First time posting, so I hope I'm following all the rules.
 A: By completing the contour, you have
$$ \int_{-\infty}^\infty \frac{dk}{ik+1} = \lim_{R\to \infty} \left(\oint_{[-R,R] \;\cup\;\Gamma_R} \frac{dz}{iz+1}- \int_{\Gamma_R} \frac{dz}{iz+1} \right), $$
where $\Gamma_R = \{Re^{it}, 0 \leq t \leq \pi\}.$
The first integral converges to $2\pi i\cdot (-i) = 2\pi$, as you have found yourself by the Residue theorem.
However, the second integral does not converge to $0$ as you assumed for some reason. We have
\begin{align}
\int_{\Gamma_R} \frac{dz}{iz+1} &= \int_0^\pi \frac{iRe^{it}}{iRe^{it}+1} \, dt
= \int_{0}^\pi 1-\frac{1}{iRe^{it}+1} \, dt \to \pi-0 = \pi, \text{ as } R\to\infty.
\end{align}
Hence,
\begin{align}
\frac{1}{2\pi}\int_{-\infty}^\infty \frac{dk}{ik+1} &= \frac{1}{2\pi}\lim_{R\to \infty} \left(\oint_{[-R,R] \;\cup\;\Gamma_R} \frac{dz}{iz+1}- \int_{\Gamma_R} \frac{dz}{iz+1} \right)\\
&= \frac{1}{2\pi} (2\pi - \pi) = \frac{1}{2},
\end{align}
as wanted.
A: Note that using $\log$ with a branch cut along the negative real axis,
$${1 \over 2\pi}\int_{-\infty}^{\infty} \frac {dk}{ik+1} = \lim_{R \to \infty} \frac{1}{2\pi i} \int_{-iR}^{iR} \frac{dz}{1+z} = \lim_{R \to \infty}\frac{1}{2\pi i} \log \left(\frac{1 + iR}{1 - iR} \right) = \frac{\pi i}{2 \pi i} = \frac{1}{2}$$
where the limit follows from the Laurent expansion
$$\log \left(\frac{1 + iR}{1 - iR} \right) = i\pi - \frac{2i}{R} + O(R^{-3})$$
A: $$\begin{align}
\int_{-\infty}^\infty{dk\over1+ik}
&=\int_{-\infty}^0{dk\over1+ik}+\int_0^\infty{dk\over1+ik}\\
&=\int_0^\infty{dk\over1-ik}+\int_0^\infty{dk\over1+ik}\\
&=\int_0^\infty\left({1\over1-ik}+{1\over1+ik} \right)dk\\
&=\int_0^\infty{2\over1+k^2}dk\\
&=2\arctan(k)\big|_0^\infty\\
&=\pi
\end{align}$$
Note, the initial improper integral should be thought of as $\int_{-\infty}^\infty=\lim_{N\to\infty}\int_{-N}^N$.
