Is there a direct proof for $\int_0^{2\pi}\frac{r^2+r(\cos t-\sin t)}{1+2r\cos t+r^2}dt=2\pi$ Is there a direct method to prove that, if $r>1$
$$I=\int_0^{2\pi}\frac{r^2+r(\cos(t)-\sin(t))}{1+2r\cos(t)+r^2}dt=2\pi$$
I ask this question because this integral can be thought as an integral of a 1-form along a circle:
$\omega=\frac{x-y}{x^2+y^2}dx+\frac{x+y}{x^2+y^2}dy$
and $\gamma=(1+r\cos(t),r\sin(t))$ for $t\in[0,2\pi]$ and if I'm not mistaken this curve is homotopic to the unit circle centered in $(0,0)$ if $r>1$, then the integral is equal to the integral along this curve that is $2\pi.$ Is my argument correct?
 A: Utilize the Fourier series
$$\frac{r^2-1}{1+2r\cos t+r^2}=1+ 2\sum_{n=1}^{\infty}\frac{(-1)^n}{r^n}\cos(nt )
$$
and observe that only the first two terms in the series survive the integration, i.e.
$$\int_0^{2\pi}\frac{r^2+r(\cos t-\sin t)}{1+2r\cos t+r^2}dt
= \frac1{r^2-1}\int_0^{2\pi}(r^2- 2\cos^2t)dt
=2\pi$$
A: We can reduce the problem a little bit. By elementary algebra and symmetry you'll see that it suffices to show that
$$
\int_0^{2 \pi} \dfrac{1+r \cos t}{1+2 r \cos t + r^2} \,dt = 0.
$$
Under suitable transformation we can evaluate this integral as
$$
\left[ -\frac{1}{2} \arctan \left(\frac{(r+1) \cos \left(\frac{t}{2}\right)}{\sin
   \left(\frac{t}{2}\right)-r \sin \left(\frac{t}{2}\right)}\right)+\frac{1}{2} \arctan \left(\frac{(r+1) \cos \left(\frac{t}{2}\right)}{r \sin
   \left(\frac{t}{2}\right)-\sin \left(\frac{t}{2}\right)}\right)+\frac{t}{2}\right]_0^{2 \pi} = 0
$$
note: Out of laziness I computed the primitive with Wolfram Mathematica, but the transformation is standard.
A: One can use the result $$\int_0^{\pi}\frac{dx}{a+b\cos x} =\frac{\pi} {\sqrt{a^2-b^2}}, a>|b|\tag{1}$$ which can be proved using the substitution $$(a+b\cos x) (a-b\cos u) =a^2-b^2$$ The given integral in question can be written as $$\frac{1}{2}\int_{0}^{2\pi}\left(1+\frac{r^2-1-2r\sin t} {1+2r\cos t+r^2}\right)\,dt$$ which equals $$\pi+(r^2-1)\int_{0}^{\pi}\frac{dt}{1+2r\cos t+r^2}+0$$ or $$\pi+\frac{\pi(r^2-1)}{\sqrt{(1+r^2)^2-4r^2}}=2\pi$$ as $|r|>1$. The integral is $0$ if $|r|<1$ and undefined if $|r|=1$.
