<s>[INST] Finding value of $\int^{2\pi}_{0}\frac{\sin^2(x)}{a-b\cos x}dx$ without contour Integration 
Finding value of $\displaystyle \int^{2\pi}_{0}\frac{\sin^2(x)}{a-b\cos x}dx\;\;, a>b>0$ without contour Integration

Try: Let $\displaystyle I =\int^{2\pi}_{0}\frac{\sin^2 x}{a-b\cos x}dx=2\int^{\pi}_{0}\frac{\sin^2 x}{a-b\cos x}dx$
Using Integration by parts
$$ I =\frac{2}{b}\bigg[\sin (x)\cdot \ln|a-b\cos x|\bigg]\bigg|^{\pi}_{0}-\frac{2}{b}\int^{\pi}_{0}\cos x\cdot \ln|a-b\cos x|dx$$
$$I=-\frac{2}{b}\int^{\pi}_{0}\cos x\cdot \ln(a-b\cos x)dx$$
Could some help me to solve it, Thanks in advance 
 [/INST] $$I=\int_0^{2\pi}\frac{\sin^2(x)}{a-b\cos(x)}dx=\int_0^\pi\frac{\sin^2(x)}{a-b\cos(x)}dx+\int_\pi^{2\pi}\frac{\sin^2(x)}{a-b\cos(x)}dx$$
now using substitution:
$$t=\tan\frac{x}{2}$$
$$dx=\frac{2}{1+t^2}dt$$
$$\sin(x)=\frac{2t}{1+t^2}$$
$$\cos(x)=\frac{1-t^2}{1+t^2}$$
because of the discontinuities of the function, we must first change the limits. Now our integral becomes:
$$I=\int_{-\pi}^\pi\frac{\sin^2(x)}{a-b\cos(x)}dx=\int_{-\infty}^\infty\frac{\left(\frac{2t}{1+t^2}\right)^2}{a-b\left(\frac{1-t^2}{1+t^2}\right)}.\frac{2}{1+t^2}dt=2\int_{-\infty}^\infty\frac{2t}{(1+t^2)^2\left(a(1+t^2)-b(1-t^2)\right)}dt=2\int_{-\infty}^\infty\frac{2t}{(1+t^2)^2\left((a-b)+(a+b)t^2\right)}dt$$
then by using PFD this can be evaluated
</s>