# Finding $\int_{0}^{\pi} 2\pi\frac{R^2(z-R\cos\theta)\sin\theta }{\sqrt{(R^2+z^2-2zR\cos\theta)^3}}\,d\theta$

I am doing some physics problem and in order to solve it I need to solve the following integral:

$$\int_{0}^{\pi} 2\pi\frac{R^2(z-R\cos\theta)\sin\theta }{\sqrt{(R^2+z^2-2zR\cos\theta)^3}}\,d\theta$$ where $$z>R$$.

Considering physics of the problem I expect to get $$\dfrac{4\pi R^2}{z^2}$$ (although that can be wrong). I tried to do substitution $$u=R^2+z^2-2zR\cos\theta$$, but I did not succeed to get the solution. Also i tried to convert that real integral into complex integral to solve it, but also I did not succeed to get the solution. So my question is how to solve that integral?

Thank you for any help!

The change of variables $$t = \frac{2 z R}{z^2+R^2} \cos(\theta)$$ yields \begin{align} f(z,R) &\equiv 2\pi R^2 \int \limits_{0}^{\pi} \frac{z-R\cos(\theta)}{(z^2+R^2-2zR\cos\theta)^{3/2}} \, \sin(\theta) \mathrm{d} \theta = \frac{\pi R}{\sqrt{z^2+R^2}} \int \limits_{-\frac{2 z R}{z^2+R^2}}^{\frac{2 z R}{z^2+R^2}} \frac{1-\frac{z^2+R^2}{2 z^2} t}{(1-t)^{3/2}} \, \mathrm{d} t \\ &= \frac{\pi R}{\sqrt{z^2+R^2}} \left[\frac{2}{\sqrt{1-t}} - \frac{z^2+R^2}{z^2} \frac{2-t}{\sqrt{1-t}}\right]_{t=-\frac{2 z R}{z^2+R^2}}^{t=\frac{2 z R}{z^2+R^2}} \, , \end{align} where the second integral can be computed via integration by parts, for example. Now plug in the limits and after a few lines of algebra you should indeed arrive at $$f(z,R) = 4 \pi \frac{R^2}{z^2} \, .$$