$\displaystyle\int_{0}^{\pi} \frac{\sin^2 x}{a^2 - 2ab\cos x +b^2} \,\mathrm dx$ An integration:
$$\int_{0}^{\pi} \frac{\sin^2 x}{a^2 - 2ab\cos x +b^2} \,\mathrm dx$$
I am stuck with this definite integral. Will putting $\,\cos x = z\,$ help out here?

The antiderivative calculated by Wolfram is
$$\frac{x(a^2+b^2)-2(a^2-b^2)\tan^{-1}\bigg(\frac{(a+b)\tan\left(\frac{x}{2}\right)}{a-b}\bigg)+2ab\sin(x)}{4a^2b^2}$$
For $a=b$, the intgegral becomes
$$\int_0^{\pi} \frac{\sin^2(x)}{2a^2(1-\cos(x)}\mathrm dx=\frac{\pi}{2a^2}$$
For $a>b$ the $\tan^{-1}$-term tends to $\frac{\pi}{2}$ because the argument tends to infinite for $x=\pi$. For $x=0$, the antiderivate is $0$.
The final result is $\dfrac{\pi}{2a^2}$
If $a<b$, either change the roles of $a$ and $b$ or use $-\dfrac{\pi}{2}$ for the problematical term in the antiderivate. The result is now $\dfrac{\pi}{2b^2}$
So, the integral is $\dfrac{\pi}{2\max(a,b)^2}$.
