Poisson's integral formula 
Evaluate  $$\int_{0}^{2\pi}\frac{1}{\rho^2+r^2-2r\rho \cos(t-\theta)}dt.$$

I found this under some exercises about Poisson's integral formula, to my surprise the problem looks simple but I do not have a single idea of how to go with it. Can somebody help?
 A: E.g. in Rudins real and complex analysis, chapter 11, you'll find the following statement:
If $u$ is a continuous and real valued function on the boundary of the disc $D(a; R)$ and if $u$ is defined in $D(a; R)$ by the Poisson integral
$$u(a+r e^{i\theta}) = \frac{1}{2\pi} \int\limits_{-\pi}^{\pi} \frac{R^2-r^2}{R^2+r^2-2 rR\cos(\theta-t)} u(a+Re^{it}) dt $$
then u is continuous on the closeure of $D(a;R)$ and harmonic in $D(a,R)$.
Your integral is -- up to a factor $\frac{R^2- r^2}{2\pi}$ -- the specialization of that integral to the constant function $u=1$. If you introduce this factor you get the harmonic extension of the constant function (which has to be constant by the maximum principle) $1$ at the origin. Hence your integral is the inverse of that factor. (You need to rename to your $r, \rho$, of course)
(Admittedly, you probably have to evaluate that integral directly to prove the aforementioned statement :-))
A: Let $z = \mathrm{e}^{i (t - \theta)}$, and assuming $\rho \not= r$, we get
$$
   \int_0^{2 \pi} \frac{1}{\rho^2 + r^2 - 2 r  \rho \cos(t - \theta) } \mathrm{d}t = 
   \oint \frac{1}{ r^2 + \rho^2 - r \rho \left( z + z^{-1} \right)} \cdot \frac{1}{i} \frac{\mathrm{d} z}{z}
  = 
   \oint \frac{1}{ (r^2 + \rho^2) z - r \rho \left( z^2 + 1 \right)} \cdot \frac{\mathrm{d} z}{i} = \oint \frac{1}{ (r z - \rho)(r - \rho z)} \cdot \frac{\mathrm{d} z}{i} = \frac{2 \pi}{| \rho^2 - r^2 |} 
   
$$
A: I would use the half angle substitution;  x=arctan (u), work it out as a rational function. It worked out for me this way, also it becomes a trig substitution integral which are always easy to solve.
