Integral that gives one or minus one Consider following integral
$$\int_{-\infty }^{\infty } \frac{\text{sech}\left(\frac{\pi  (-a+x+1)}{c}\right)}{c} \, dx$$ with $c$ real and $a$ is a complex number of the form $e^{i\phi}$ for real $\phi$.
Looks like this integral is either 1 or -1 which is what I got from Mathematica.
How do I determine the range of $a$ (or $c e^{i\phi}$) for which this integral is positive 1 and range for which it is $-1$?
I suspect this is related to
\begin{equation}
\frac{2 \left(\tan ^{-1}(x)+\cot ^{-1}(x)\right)}{\pi }=\pm 1
\end{equation}
for complex x. But I am not quite sure.
 A: Let $y=\frac{\pi(x+1)}{c}$ and $A=\frac{a\pi}{c}$. Then the integral becomes $$\int_{-\infty}^{\infty}\frac{2}{\pi} \frac{e^{y-A}}{e^{2(y-A)}+1} dy.$$ If $A$ were real, this would be (translating out $A$) $$\left|\frac{2}{\pi} \arctan\big(e^y\big)\right|_{-\infty}^{\infty}=1.$$ The effect of $A$ not being real is to shift the line of integration in the imaginary direction by $\mathrm{Im } A$ to get $$\int_{-\infty+ i\mathrm{Im}A}^{\infty+ i\mathrm{Im}A}\frac{2}{\pi} \frac{e^{y}}{e^{2y}+1} dy.$$ and this will affect the integral by moving across poles of the integrand. I think the residue at each pole is $2$ or $-2$, so I would expect the value of the integral to alternate between $\pm 1$ as the imaginary part of $\frac{a}{c}$ increases, changing each time $\mathrm{Im} A$ passes a pole, at $(n+\frac{1}{2})\pi$.
A: As I suspected,
The integral becomes
$\int_{-\infty }^{\infty } \frac{\text{sech}\left(\frac{\pi  \left(e^{i a}+x-1\right)}{c}\right)}{c} \, dx=\frac{2}{\pi } \left(\tan ^{-1}\left(e^{\frac{\pi  \left(-1+e^{i a}\right)}{c}}\right)+\cot ^{-1}\left(e^{\frac{\pi  \left(-1+e^{i a}\right)}{c}}\right)\right)$
and now it is pretty clear that it has to be $\pm 1$ depending on whether the real part of the argument is positive or negative for the principal values.
