Integration error in Levinson Redheffer On pages 193-194 of Levinson/Redheffer Complex Analysis, the authors set out to compute the integral
$$
  \int_0^{2\pi} \frac{1}{a+\cos x} dx
$$
and reach the wrong conclusion that the integral is equal to 
$\frac{2\pi}{\sqrt{a^2 -1}}$, for any complex value of "a" outside the slit [-1,1].
It is fairly easy to see that the result is wrong. The integrals have opposite signs at $a=i$ and $a=-i$ while the formula given has no variation of signs.
They compute the formula for $a$ real and $a>1$ (which is correct) and then extend it to the whole slitted-plane using some form of analytic continuation.
The question is -- What did they do wrong? And how come this is wrong for decades in a textbook?
 A: I've now discussed this with @mrf, and I think that we agreed on the following (we do not have the book by Levinson/Redheffer, so we don't know the explanation in there):
First of all, the original integral is clearly convergent for all complex $a$ in the complement of $[-1,1]$, so we would like to have a formula working for all such $a$.
The problem with the formula in the book is how to interpret $\sqrt{a^2-1}$, and the problem is that the square root is not defined for nonpositive real numbers[1]. Since $a^2-1$ is nonpositve and real precisely when $a$ is purely imaginary or $-1\leq a\leq 1$, there is indeed a problem here.
If we interpret $\sqrt{a^2-1}$ as $a\sqrt{1-1/a^2}$ we get something working for all complex $a$ outside $[-1,1]$ since $1-1/a^2$ is nonpositive and real if and only if $a\in[-1,1]$. It would have been better to write
$$
\int_0^{2\pi}\frac{1}{a+\cos x}\,dx=\frac{2\pi}{a\sqrt{1-1/a^2}}.
$$
We can only guess where the problem appears: By letting $z=e^{ix}$ we are led to the integral
$$
-2i\int_{|z|=1}\frac{1}{z^2+2az+1}\,dz
$$
and in finding the poles, we are led to solve the quadratic equation $(z+a)^2=a^2-1$, and here is the step where it (for the reason above) would have been better writing
$$
z=-a\pm a\sqrt{1-1/a^2}
$$
instead of
$$
z=-a\pm\sqrt{a^2-1}.
$$
[1] The principal argument of $z\in\mathbf{C}$ is sometimes (this is a matter of taste, for example it is done so by Mathematica) defined to be in the interval $-\pi<\text{arg}\,z\leq \pi$, including the value $\pi$ (see my second comment to the question). This implies that the argument/logarithm/square root is indeed defined for negative $z$ (but no longer continuous on its domain). With this definition/interpretation the formula in the book indeed becomes wrong. In this setting, the value of the integral can also be written as
$$
\frac{2\pi}{\sqrt{a-1}\sqrt{a+1}}.
$$
