"Using the substitution $t=\tan \frac{x}{2}$, prove that for every $-1<r<1$, $\int_{0}^{\pi}\frac{\cos x}{1-2r\cos x+r^2}dx=\int_{0}^{\pi}\frac{r}{1-2r\cos x+r^2}dx$ "
I've tried the suggestion, and this is what I was able to deduce: $ \int_{0}^{\pi}\frac{\cos x}{1-2r\cos x+r^2}dx= \begin{bmatrix} t=\tan \frac{x}{2} & dx=\frac{2dt}{1+t^2} \\ cosx=\frac{1-t^2}{1+t^2} & \end{bmatrix}=\int_{0}^{\infty}\frac{\frac{1-t^2}{1+t^2}}{1-2r\frac{1-t^2}{1+t^2}+r^2}\frac{2dt}{1+t^2}= \\\ \int_{0}^{\infty}\frac{2(1-t^2)}{(1+t^2)^2-2r(1-t^2)(1+t^2)+r^2(1+t^2)^2}dt$
and
$\\\ \int_{0}^{\pi}\frac{r}{1-2r\cos x+r^2}dx= \begin{bmatrix} t=\tan \frac{x}{2} & dx=\frac{2dt}{1+t^2} \\ \cos x=\frac{1-t^2}{1+t^2} & \end{bmatrix}=\int_{0}^{\infty}\frac{r}{1-2r\frac{1-t^2}{1+t^2}+r^2}\frac{2dt}{1+t^2}= \\\ \int_{0}^{\infty}\frac{2r}{(1+t^2)-2r(1-t^2)+r^2(1+t^2)}dt $
but I can't see how am I closer to the solution now. Thanks for your help!
${\begin{align} {\text{When r=0 the result is trivial. Consider now -1<r<0 or 0<r<1.}}\end{align}\\}$
${\begin{align} {\int_{0}^{\pi} {cos(x)\over{1-2rcos(x)+r^2}}dx = {\int_{0}^{\pi} {r\over{1-2rcos(x)+r^2}}dx} }\end{align}\\}$
iff
${\begin{align} {\int_{0}^{\pi} {cos(x)-r\over{1-2rcos(x)+r^2}}dx = 0 }\end{align}\\}$
Now use substitution
${\begin{align} {t = tan({x\over2})}\end{align}\\}$
you get
${\begin{align} {2\int_{0}^{+\infty} {{(r+1)t^2+(r-1)}\over{(1+t^2)((1+r)^2t^2+(r-1)^2)}}dx = 0 }\end{align}\\}$
Observe that for every r s.t. ${-1<r<0\ or\ 0<r<1}$ the polynomial ${(1+r)^2t^2+(r-1)^2}$ has no real roots.
From this point you can compute this integral via the theory of integration of rational functions.
${\begin{align} {(r+1)t^2 + r-1 \over{(1+t^2)((1+r)^2t^2+(1-r)^2)}} = {{At+B}\over{(1+r)^2t^2 + (r-1)^2}} + {{Ct+D}\over{1+t^2}}\end{align}}$
You find ${\begin{align} A = 0 \ B = {r^2-1\over {2r}} \ C = 0\ D = {1\over {2r}}. \end{align}} $
${\begin{align} {2\int_{0}^{+\infty} {{(r+1)t^2+(r-1)}\over{(1+t^2)((1+r)^2t^2+(r-1)^2)}}dx = {2\int_{0}^{+\infty} {{r^2-1\over 2r}{1\over{(1+r)^2t^2+(r-1)^2}}} + {1\over 2r} {1\over {1+t^2}}}dx}\end{align}\\}$
${\begin{align} {\lim_{A\rightarrow +\infty} {2\int_{0}^{A} {{r^2-1\over 2r}{1\over{(1+r)^2t^2+(r-1)^2}}} + {1\over 2r} {1\over {1+t^2}}}dx} = \lim_{A\rightarrow +\infty}{1\over r} {arctan({{(r+1)A}\over{r-1}}) + {1\over r} {arctan(A)} = 0}\end{align} }$
Observe that ${\begin{align} {{r+1}\over{r-1}} < 0 \text{ for every } -1<r<0 \text{ or } 0<r<1 \end{align} } $