# Algebraic integral involving complex numbers

I need some help analytically proving the following with elementary tools:

$$\int_1^{+\infty} \frac{z^i + z^{-i}}{z^2 + 1} ~ \mathrm{d} z = \frac{\pi}{2} \mathrm{sech} \left ( \frac{\pi}{2} \right )$$

I tried substitution using the hyperbolic trigonometric functions, integrating by parts, but nothing seems to help make this integral simpler. I think the power of $i$ is what's giving me trouble, because if it was $z^3$ at the top for instance, it would be relatively easy. $z$ is a real, and the integral converges to a real as well.

I thought about multiplying the numerator and denominator by $z^i$ (and $z^{-i}$ for the other term) and using partial fractions to simplify the denominator into smaller terms I could integrate directly, but I am unsure how to proceed with exponents of $i$, since polynomials can only have real exponents. Wolfram Alpha doesn't simplify it either, which leads me to believe I can't do it that way.

-
Have you tried using the substitution z=e^x? See where that gets you! –  Kijang Jan 1 '13 at 21:00

Hint: expand in series $\dfrac{1}{z^2+1}$
I don't see how exactly this could help, but anyway: wouldn't there be some problem as the series for the derivative of $\,\arctan z\,$ exists only for $\,|z|<1\,$ , whereas the integral is from one to $\,\infty\,$ ? –  DonAntonio Jan 1 '13 at 11:42
Laurent series (i.e. series in powers of $1/z$), not Maclaurin series. –  Robert Israel Jan 1 '13 at 21:13