Evaluating a Cauchy integral $\frac{1}{2\pi}$ $\int_{0}^{2\pi} \frac{d\theta}{(1-2r\cos\theta+r^2)}$ Evaluate 
$$\frac{1}{2\pi}\int_{0}^{2\pi} \frac{d\theta}{(1-2r\cos\theta+r^2)}$$ for $0 < r < 1$ by writing ${\cos\theta}$ = $\frac{1}{2}$($ e^{i\theta}+e^{-i\theta})$ and reducing the given integral to a complex integral over the unit circle. 
I believe I am supposed to use the Cauchy Integral formula and find the Taylor series centered at $z_0$ but not sure how to proceed
 A: Since $\int_{0}^{2\pi}e^{ni\theta}e^{-mi\theta}\,d\theta=2\pi \delta(m,n)$ and
$$ \frac{1}{1-2r\cos\theta+r^2}=\frac{1}{(1-r e^{i\theta})(1-r e^{-i\theta})}=\left(\sum_{n\geq 0}r^n e^{in\theta}\right)\cdot\left(\sum_{m\geq 0}r^m e^{-mi\theta}\right) $$
we have that
$$ \frac{1}{2\pi}\int_{0}^{2\pi}\frac{d\theta}{1-2r\cos\theta+r^2} = \sum_{n\geq 0}r^{2n}=\frac{1}{1-r^2}.$$
A: Using the substitution $z:=re^{i\theta}$ you can rewrite the integral as
$$\frac{1}{2\pi}\int^{2\pi}_0\frac{\,d\theta}{(re^{i\theta}-1)(re^{-i\theta}-1)}=\frac{1}{2\pi i}\oint_{|z|=r}\frac{\,dz}{z(z-1)(\overline{z}-1)}=\frac{1}{2\pi i}\oint_{|z|=r}\frac{\,dz}{(z-1)(|z|^2-z)}$$
which is the same as using $|z|=r$
$$\frac{1}{2\pi i}\oint_{|z|=r}\frac{\,dz}{(z-1)(r^2-z)}$$
Since $0< r<1$ then $r^2<r$ so there is only one simple pole at $z=r^2$ with residue $1/(1-r^2)$. Hence by Cauchy's residue theorem you get
$$\frac{1}{2\pi i}\oint_{|z|=r}\frac{\,dz}{(z-1)(r^2-z)}=\frac{1}{2\pi i}\cdot 2\pi i\cdot\text{Res}(\frac{1}{(z-1)(r^2-z)},0)=\frac{1}{1-r^2}$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

With $\ds{r \in \mathbb{R}\setminus\braces{-1,1}}$:

\begin{align}
&\bbox[10px,#ffd]{\ds{{1 \over 2\pi}\int_{0}^{2\pi}{\dd\theta \over 1 - 2r\cos\pars{\theta} + r^{2}}}} =
{1 \over 2\pi}\int_{-\pi}^{\pi}{\dd\theta \over 1 + 2r\cos\pars{\theta} + r^{2}} =
{1 \over \pi}\int_{0}^{\pi}{\dd\theta \over 1 + 2r\cos\pars{\theta} + r^{2}}
\\[5mm] = &\
{1 \over \pi}\int_{-\pi/2}^{\pi/2}{\dd\theta \over
1 - 2r\sin\pars{\theta} + r^{2}} =
{1 \over \pi}\int_{0}^{\pi/2}\bracks{%
{1 \over 1 - 2r\sin\pars{\theta} + r^{2}} +
{1 \over 1 + 2r\sin\pars{\theta} + r^{2}}}\dd\theta
\\[5mm] = &\
{2\pars{1 + r^{2}} \over \pi}\int_{0}^{\pi/2}{\dd\theta \over
\pars{1 + r^{2}}^{2} - 4r^{2}\sin^{2}\pars{\theta}}
\\[5mm] = &\
{2\pars{1 + r^{2}} \over \pi}\int_{0}^{\pi/2}{\sec^{2}\pars{\theta}\,\dd\theta \over
\pars{1 + r^{2}}^{2}\sec^{2}\pars{\theta} - 4r^{2}\tan^{2}\pars{\theta}}
\\[5mm] = &\
{2\pars{1 + r^{2}} \over \pi}
\int_{0}^{\pi/2}{\sec^{2}\pars{\theta}\,\dd\theta \over
\pars{1 - r^{2}}^{2}\tan^{2}\pars{\theta} + \pars{1 + r^{2}}^{2}}
\\[5mm] = &\
{2 \over \pi\verts{1 - r^{2}}}\int_{0}^{\infty}
{\dd t \over t^{2} + 1} = \bbx{{1 \over \verts{1 - r^{2}}}\,,\quad
r \in \mathbb{R}\setminus\braces{-1,1}}\quad
\mbox{with}\quad t \equiv {\verts{1 - r^{2}} \over 1 + r^{2}}\,\tan\pars{\theta}
\end{align}
A: Factorise the denominator. Write the integrand as a product of infinite series, then as a sum of terms of the form $\int r^k e^{li\theta}$ for integers $k,\,l$ with $k\ge 0$. Use $\int_0^{2\pi}e^{li\theta}d\theta =2\pi\delta_{l0}$ (that's a Kronecker delta there). You'll only have a geometric series of common ratio $r^2$ left to worry about.
A: Looks like an application of the mean value theorem for harmonic functions $u$ on a region containing the closed unit disk $|z|\leq 1$. Then, for any $|z_0| < 1$ we have:
$$u(z_0) = \frac{1}{2\pi}\int_{0}^{2\pi} u(e^{i\theta})\frac{1-|z_0|^2}{|z_0-e^{i\theta}|^2}\, dz$$
$\frac{1}{2\pi}\int_{0}^{2\pi} \frac{d\theta}{1-2r\cos\theta+r^2} = \frac{1}{2\pi}\int_{0}^{2\pi} \frac{1}{(r-\cos\theta)^2 + \sin^2\theta}\, d\theta \stackrel{z_0 = r,\, u(z) = 1}{=}\frac{1}{2\pi}\int_{0}^{2\pi} 1 \cdot \frac{1-r^2}{|r-e^{i\theta}|^2}\cdot \frac{1}{1-r^2}\, d\theta = \frac{1}{1-r^2}$
