Evaluating $\frac{1}{2\pi}\int_{0}^{2\pi}\frac{1}{1-2t\cos\theta +t^2}d\theta$ I need solve this integral, and I tried various methods of solving and did not get it. The integral is: 
$$\frac{1}{2\pi}\int_{0}^{2\pi}\frac{1}{1-2t\cos\theta +t^2}d\theta,$$
where $t$ is a positive integer.
 A: This is the famous Poisson kernel (see http://en.wikipedia.org/wiki/Poisson_kernel). For example, ${\displaystyle \frac{1}{1 - 2t\cos\theta + t^2} = {1 \over 1 - t^2}Re\bigg(\frac{1 + te^{i\theta}}{1 - te^{i\theta}}\bigg)}$, so you're looking for the real part of
$${1 \over 2\pi(1 - t^2)}\int_0^{2\pi}{\frac{1 + te^{i\theta}}{1 - te^{i\theta}}}d\theta$$
As a complex integral this is
$${1 \over 2\pi i(1 - t^2)}\int_{|z| = 1}\frac{1 + tz}{z(1 - tz)}\,dz$$
By the Cauchy integral formula this evaluates to
$${1 \over 1 - t^2}$$
This is already real, so this is also the real part which is your answer.
A: HINT: Weierstrass Substitution
A: It is easier to use techniques from complex variables (residue theorem), substitute $ \cos(\theta) = \frac{z+\frac{1}{z}}{2} \,$ where $  z=\exp{(i\theta)}$ and integrate 
$$ \frac{1}{2\pi}\oint_{|z|=1}\frac{1}{1-2t\frac{z+\frac{1}{z}}{2} +t^2}d\theta = \dots $$
A: $$\frac{1}{1-2t\cos \theta +t^2}=\frac 1{1+t^2-2t\frac{(1-\tan^2\frac{\theta}2)}{(1+\tan^2\frac{\theta}2)}}$$
$$=\frac{\sec^2\frac{\theta}2}{(1+t^2)(1+\tan^2\frac{\theta}2)-2t(1-\tan^2\frac{\theta}2)}=\frac{\sec^2\frac{\theta}2}{(1-t)^2+\tan^2\frac{\theta}2(1+t)^2}$$
$$=\frac1{(1+t)^2}\frac{\sec^2\frac{\theta}2}{(\frac{1-t}{1+t})^2+\tan^2\frac{\theta}2}$$
If $f(\theta)=\frac{1}{1-2t\cos \theta +t^2}, f(2\pi-\theta)=f(\theta)$,
So, $\int_{0}^{2\pi}f(\theta)d\theta=2\int_{0}^{\pi}f(\theta)d\theta$ 
$$I=\frac{1}{2\pi}\int_{0}^{2\pi}\frac{1}{1-2t\cos\theta +t^2}d\theta
=\frac{1}{\pi}\int_{0}^{\pi}\frac{1}{1-2t\cos\theta +t^2}d\theta,$$
$$=\frac{1}{\pi(1+t)^2}\int_{0}^{\pi}\frac{\sec^2\frac{\theta}2}{(\frac{1-t}{1+t})^2+\tan^2\frac{\theta}2}d\theta$$
Now we can put $z=\tan \frac{\theta}2$ in the given problem, if $\theta=0,z=0$ and if $\theta=\pi,z=∞$ and $dz=\frac{\sec^2\frac{\theta}{2}d\theta}{2}$
So, $$I=\frac{1}{\pi(1+t)^2}\int_{0}^{∞}\frac{2dz}{(\frac{1-t}{1+t})^2+z^2}$$
$$=\frac{2}{\pi(1-t^2)} \tan^{-1}{\frac{(1+t)z}{1-t}} \mid_{0}^{∞}$$
At $z=0, \tan^{-1}{\frac{(1+t)z}{1-t}}=0$ if $t \ne 1$
At $z=∞, \tan^{-1}{\frac{(1+t)z}{1-t}}=\frac{\pi}2$ if $ \frac{1+t}{1-t}>0 $ or if $ \frac{(1+t)(1-t)}{(1-t)^2}>0$ or if $1-t^2>0$ or if $-1< t< 1$
At $z=∞, \tan^{-1}{\frac{(1+t)z}{1-t}}=-\frac{\pi}2$ if $t>1$ or $t<-1$
A: This can be generalized into complex field. Namely,


Evaluating $$I=\int_{0}^{2\pi}\frac{d\theta}{1-2\alpha\cos\theta+\alpha^2}$$where $\alpha$ is a complex number, $|\alpha| \neq 1$.

First of all we have
$$
\int_{0}^{2\pi}\frac{d\theta}{1-2\alpha\cos\theta+\alpha^2}=\int_{0}^{2\pi}\frac{d\theta}{(e^{i\theta}-\alpha)(e^{-i\theta}-\alpha)}
$$
With $z=e^{i\theta}$, we have $\theta=\frac{\log{z}}{i}$, and $d\theta=\frac{1}{iz}dz$. Therefore
$$
I=\oint\limits_{|z|=1}\frac{d\theta}{i(z-\alpha)(1-\alpha{z})}
$$
Then the evaluation becomes nothing but a residue problem. W.L.O.G. we assume $|\alpha|>1$, then
$$
I=2\pi i\frac{1}{i(\alpha-1/\alpha)\alpha}=2\pi/(\alpha^2-1)
$$
So the answer to the original question is $\frac{1}{t^2-1}$
