TITLE: Show $ \int_{-\pi}^{\pi}  \frac{1 - \cos (n+1) x}{1- \cos x} dx = (n+1) 2 \pi$ for $n \in \mathbb N$
QUESTION [6 upvotes]: Possible Duplicate:
Compute the trigonometric integrals 

For $n \in \mathbb N$, $$ \int_{-\pi}^{\pi}  \frac{1 - \cos (n+1) x}{1- \cos x} dx = (n+1) 2 \pi$$

REPLY [3 votes]: Setting $z=e^{ix}$ and denoting by $C$ the unit circle, one has
$$
I_n:=\int_{-\pi}^\pi\frac{1-\cos(n+1)x}{1-\cos x}dx=-i\oint_Cf(z)dz,
$$
where
$$
f(z)=\frac{z^{n+1}+z^{-n-1}-2}{z(z+z^{-1}-2)}=\frac{(1+z+\ldots+z^n)^2}{z^{n+1}}=\frac{(P_n(z))^2}{z^{n+1}}.
$$
Thanks to the Residue Theorem, one gets
\begin{eqnarray}
I_n&=&2\pi\text{Res}(f,0)=\frac{2\pi}{n!}\lim_{z \to 0}\frac{d^n}{dz^n}\left[z^{n+1}f(z)\right]=\frac{2\pi}{n!}\lim_{z \to 0}\frac{d^n}{dz^n}(P_n(z))^2\cr
&=&\frac{2\pi}{n!}\lim_{z \to 0}\sum_{k=0}^n{n\choose k}P_n^{(k)}(z)P_n^{(n-k)}(z)
=\frac{2\pi}{n!}\sum_{k=0}^n{n\choose k}P_n^{(k)}(0)P_n^{(n-k)}(0).
\end{eqnarray}
Since $P_n(z)=1+z+\ldots+z^n$, one has $P_n^{(k)}(0)=k!$ for every $k \in \{0,\ldots, n\}$. Hence
$$
I_n=\frac{2\pi}{n!}\sum_{k=0}^n{n\choose k}k!(n-k)!=2\pi\sum_{k=0}^n1=2(n+1)\pi.
$$