In his paper "The Evaluation and Estimation of the Coefficients in the Chebyshev Series Expansion of a Function", David Elliott writes:



> 
> Writing $x = \cos(\theta)$, it can easily be shown that
>  $$
> \int\_{-1}^1 \frac{T\_n(x)}{\sqrt{1-x^2} \, (z-x)} \, dx
> =
> \int\_0^\pi \frac{\cos(n\theta)}{z - \cos(\theta)}\, d\theta
> =
> \frac{\pi}{\sqrt{z^2-1} \, (z\pm \sqrt{z^2-1})^n}
> $$
>  where the sign is chosen so that $|z \pm \sqrt{z^2 -1}| > 1$. 
> 
> 
> 


The middle expression here has been added by myself to show what you get after the substitution $x= \cos(\theta)$. I fail to see how the second equality comes about. Any pointers would be greatly appreciated. 



Chebyshev coefficient of $1/(z-x)$
The integral equals $\frac12\int\_{-\pi}^\pi \frac{e^{in\theta}}{z-\cos \theta}d\theta$. Consider the integral over the rectangle with vertices $\pm \pi$, $\pm \pi+iT$ for large $T>0$. The integrals over vertical sides cancel, since the function if $2\pi$-periodic, the integral over high horizontal side tends to 0 for large $T$. So, the difference between the integral over $[-\pi,\pi]$ and over rectangular contour tends to 0. The value of the contour integral may be calculated using residues. The equation $\cos \theta=z$ has two series of solutions $\pm \theta\_0+2\pi k,k\in \mathbb{Z}$, without loss of generality the point $\theta\_0$ is the unique root inside the contour. It remains to calculate the residue $e^{in\theta\_0}/-\sin\theta\_0$ that is straightforward, you only have to be careful with the sign of $\sin\theta\_0=\pm\sqrt{1-z^2}$.


