Selecting functions expressed with complex analysis I just read the identity, for $x>0$,
$$\frac{1}{2i\pi} \int_{x-i\infty}^{x+i\infty} y^s \frac{ds}{s} = 
\left\{
\begin{array}{cl}
1 & \text{if } y > 1 \\
0 & \text{if } 0 < y < 1 \\
\end{array}
\right.
$$
It do not understand what this integral is true, nor have I much clues on how to address such complex integrals. It is said that it is true by "residue calculus", does this mean that we should use the Cauchy residue theorem? I do not understand how it helps here.
 A: Let $b=\ln y$.
Then, your integral is
$$I(b)=\lim_{R\to\infty}\int^{x+iR}_{x-iR}e^{bs}s^{-1}ds$$

When $b>0$:
Pick a contour $\Gamma(R)=\gamma_1\cup\gamma_2$, parametrized by
$$\gamma_1:~~~~s(t)=x+it, -R\le t\le R$$
$$\gamma_2:~~~~s(t)=x+Re^{it}, \frac{\pi}2\le t\le \frac{3\pi}2$$
If you draw it out, it is the integration path of $I(b)$ plus a semicircle on the left, forming a closed contour.
By residue theorem,
$$\oint_{\Gamma}e^{bs}s^{-1}ds=2\pi i\operatorname*{Res}_{s=0}e^{bs}s^{-1}=2\pi i$$
Also, 
$$\begin{align}
\left|\int_{\gamma_2}e^{bs}s^{-1}ds\right|
&=\left|\int^{3\pi/2}_{\pi/2}e^{bx}~e^{bR\exp(it)}\frac{iRe^{it}}{x+Re^{it}}dt \right|\\
&\le \int^{3\pi/2}_{\pi/2}\left|e^{bx}~e^{bR\exp(it)}\frac{iRe^{it}}{x+Re^{it}}\right|dt \\
&=\int^{3\pi/2}_{\pi/2}e^{bx}~e^{bR\cos t}\frac{R}{|x+Re^{it}|}dt \\
&=\pi e^{bx}~e^{bR\cos c}\frac{R}{|x+Re^{ic}|} \qquad{\text{where $c\in\left[\frac{\pi}2,\frac{3\pi}2\right]$}} \\
&\xrightarrow{R\to\infty} 0 
\end{align}
$$
Thus we have that $I(b)=2\pi i$ when $b>0$.

When $b<0$:
Pick a contour $\Gamma(R)=\gamma_1\cup\gamma_2$, parametrized by
$$\gamma_1:~~~~s(t)=x+it, -R\le t\le R$$
$$\gamma_2:~~~~s(t)=x+Re^{it}, -\frac{\pi}2\le t\le \frac{\pi}2$$
If you draw it out, it is the integration path of $I(b)$ plus a semicircle on the right, forming a closed contour.
Since no singularities are enclosed,
$$\oint_{\Gamma}e^{bs}s^{-1}ds=0$$
Also, 
$$\begin{align}
\left|\int_{\gamma_2}e^{bs}s^{-1}ds\right|
&=\left|\int^{-\pi/2}_{\pi/2}e^{bx}~e^{bR\exp(it)}\frac{iRe^{it}}{x+Re^{it}}dt \right|\\
&\le \int^{-\pi/2}_{\pi/2}\left|e^{bx}~e^{bR\exp(it)}\frac{iRe^{it}}{x+Re^{it}}\right|dt \\
&=\int^{-\pi/2}_{\pi/2}e^{bx}~e^{bR\cos t}\frac{R}{|x+Re^{it}|}dt \\
&=\pi e^{bx}~e^{bR\cos c}\frac{R}{|x+Re^{ic}|} \qquad{\text{where $c\in\left[\frac{-\pi}2,\frac{\pi}2\right]$}} \\
&\xrightarrow{R\to\infty} 0 
\end{align}
$$
Thus we have that $I(b)=0$ when $b>0$.

Assembling everything we have,
$$\int^{x+i\infty}_{x-i\infty}e^{bs}s^{-1}ds=
\begin{cases}
2\pi i, &b>0 \\
0, &-\infty<b<0 \\
\end{cases}
$$
Substituting in $b=\ln y$ and dividing both sides by $2\pi i$ one recovers
$$\color{red}{
\frac1{2\pi i}\int^{x+i\infty}_{x-i\infty}y^{s}\frac{ds}s=
\begin{cases}
1, &y>1 \\
0, &0<y<1 \\
\end{cases}
}
$$
as expected.
