Help with this integral substitution This came up in my physics exercise:
$$\int_{\theta=0}^{\pi}\frac{\cos\left ( \theta \right )\sin\left ( \theta \right )}{\sqrt{R^{2}+r^{2}-2Rr\cos\left ( \theta \right )}}d\theta$$
I've tried the substitution $u=$ everything under the square root but it didn't worked.
I don't like this integral.
Any help is appreciated.
Thanks in advance.

Let $u=R^2+r^2-2Rr\cos\theta,\;$ so $du=2Rr\sin\theta d\theta$ and $\cos\theta=\frac{R^2+r^2-u}{2Rr}$.
Then $\displaystyle\int_{0}^{\pi}\frac{\cos\left ( \theta \right )\sin\left ( \theta \right )}{\sqrt{R^{2}+r^{2}-2Rr\cos\left ( \theta \right )}}d\theta=\frac{1}{2Rr}\int_{(R-r)^2}^{(R+r)^2}\frac{\frac{R^2+r^2-u}{2Rr}}{\sqrt{u}}du=\frac{1}{4R^2r^2}\int_{(R-r)^2}^{(R+r)^2}\left(\frac{R^2+r^2}{\sqrt{u}}-\sqrt{u}\right)du$
$\displaystyle=\frac{1}{4R^2r^2}\left[2(R^2+r^2)\sqrt{u}-\frac{2}{3}u^{3/2}\right]_{(R-r)^2}^{(R+r)^2}$
$\displaystyle=\frac{1}{4R^2r^2}\left[2(R^2+r^2)\big[(R+r)-(R-r)\big]-\frac{2}{3}\big[(R+r)^3-(R-r)^3\big]\right]$
$\displaystyle=\frac{1}{4R^2r^2}\left[2(R^2+r^2)(2r)-\frac{2}{3}(6R^2r+2r^3)\right]=\frac{1}{4R^2r^2}\left[4r-\frac{4}{3}r^3\right]=\color{blue}{\frac{2r}{3R^2}}$
