Asymptotic expansion $ \int_0^\infty \frac{e^{ikx}}{x+i} dx \approx -\log(-i|k|) $ as $k\to 0$ As $k \to 0$, Mathematica tells me that
$$ \int_0^\infty \frac{e^{ikx}}{x+i} dx \approx -\log(-i|k|) ,$$
where $k\in \mathbb R$. This is obtained by explicitly evaluating the LHS at arbitrary $k$, and then take the asymptotic limit. However, this method gives little insight since the result of the integral of LHS is very complicated. The log behavior is very peculiar.
Is there a way to derive the above equation by not explicitly evaluating the integral?
I tried integration by parts as
$$\int_0^\infty \frac{e^{ikx}}{x+i} dx = -\frac 1k -\frac ik \int_0^\infty \frac{e^{ikx}}{(x+i)^2} dx,$$
but it gives rather $1/k$ behavior.
 A: Using the exponential integral function
$$I=\int_0^\infty \frac{e^{ikx}}{x+i}\, dx= -e^k \,\text{Ei}(-k)$$ Epanded as a series around $k=0$
$$I= -\log (k)-\gamma -k \,(\log (k)+\gamma -1)+O\left(k^2\right)$$
Let $k=10^{-n}$ and compare
$$\left(
\begin{array}{ccc}
n & \text{approximation} & \text{numerical integration} \\
 3 & 6.33787 & 6.33784 -3.34245\times 10^{-5}\, i \\
 4 & 8.63409 & 8.63408 -9.67317\times 10^{-6}\, i \\
 5 & 10.9358 & 10.9358 +1.97341\times 10^{-6}\, i \\
 6 & 13.2383 & 13.2383 -5.52456\times 10^{-7}\, i
\end{array}
\right)$$
A: To the nice solution by @Claud Leibovici we can add another approach - via complex integration. Let's consider the following integral:
$$I=\oint\frac{e^{ikz}}{z+i}dz$$
along the following closed contour in the complex plane:

We do not have any singularities inside our contour; therefore
$$I=\int_0^\infty\frac{e^{ikx}}{x+i}dx+I_R+\int_{i\infty}^0\frac{e^{ikz}}{z+i}dz=0$$
where $I_R$ denotes integration along the arch of the radius $R\to\infty$. This integral tends to zero. Indeed,
$$|I_R|=\bigg|\int_0^{\pi/2}\frac{e^{ikRe^{i\phi}}}{i+Re^{i\phi}}iRe^{i\phi}d\phi\bigg|<\int_0^{\pi/2}\bigg|\frac{e^{ikRe^{i\phi}}}{i+Re^{i\phi}}iRe^{i\phi}d\phi\bigg|$$
$$=\int_0^{\pi/2}\frac{e^{-kR\sin\phi}\,R}{\sqrt{R^2\cos^2\phi+(1+R\sin\phi)^2}}d\phi<\int_0^{\pi/2}e^{-kR\sin\phi}d\phi$$
Given that on the interval $[0;\pi/2]\,\, \sin x>\frac{2}{\pi}x$
$$|I_R|<\int_0^{\pi/2}e^{-2kRx/\pi}d\phi=\frac{\pi}{2kR}\big(1-e^{-kR}\big)\to 0\,\,\text {at}\,\, R\to\infty$$
It means
$$\int_0^\infty\frac{e^{ikx}}{x+i}dx=\int_0^\infty\frac{e^{-kx}}{x+1}dx=e^{-kx}\ln(1+x)\,\Big|_0^\infty+k\int_0^\infty e^{-kx}\ln(1+x)dx$$
Making the substitution $1+x=t$
$$=k\int_1^\infty e^{-k(t-1)}\ln tdt=ke^k\int_0^\infty e^{-kt}\ln tdt-ke^k\int_0^1 e^{-kt}\ln tdt$$
Making the substitution $x=kt$ in the first integral and decomposing the exponent into the Taylor's series in the second
$$=e^k\Big(\int_0^\infty e^{-x}\ln xdx-\ln k\int_0^\infty e^{-x}dx\Big)-ke^k\int_0^1\ln x\Big(1-kx+\frac{(kx)^2}{2!}-...\Big)dx$$
$$=-e^k(\gamma+\ln k)-ke^k\sum_{n=0}^\infty\frac{(-1)^nk^n}{n!}\int_0^1x^n\ln xdx$$
$$=e^k\Big(\sum_{n=1}^\infty(-1)^{n+1}\frac{k^n}{n \,n!}-\gamma-\ln k\Big)$$
