Integrating $\int_{-\pi}^{\pi} \frac{ d\theta}{w - sin \theta}$ I know that the integral
$$\int_{-\pi}^{\pi} \frac{ d\theta}{w - sin \theta} = \frac{2\pi}{\sqrt{w^2-1}}$$
where w, is an arbitrary constant and at some point you must do the substitution $$u = tan( \frac{\theta}{2} )$$ Does any one know how to do the intermediate steps?
 A: Hint: Prior to performing the tangent half-angle substitution, it can be worthwhile to apply a few other transformations to put the integral into a more suitable form. For example, 
$$\begin{align}
I(w)
&=\int_{-\pi}^{\pi}\frac{\mathrm{d}\theta}{w-\sin{\theta}}\\
&=\int_{0}^{\pi}\frac{\mathrm{d}\theta}{w-\sin{\theta}}+\int_{-\pi}^{0}\frac{\mathrm{d}\theta}{w-\sin{\theta}}\\
&=\int_{0}^{\pi}\frac{\mathrm{d}\theta}{w-\sin{\theta}}+\int_{0}^{\pi}\frac{\mathrm{d}\theta}{w+\sin{\theta}}\\
&=\int_{0}^{\pi}\frac{2w\,\mathrm{d}\theta}{w^2-\sin^2{\theta}}\\
&=\int_{0}^{\pi}\frac{2w\,\mathrm{d}\theta}{w^2-\frac{1-\cos{2\theta}}{2}}\\
&=\int_{0}^{\pi}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}\\
&=\int_{0}^{\pi/2}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}+\int_{\pi/2}^{\pi}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}\\
&=\int_{0}^{\pi/2}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}+\int_{\pi-\pi/2}^{\pi-\pi}\frac{-4w\,\mathrm{d}\theta}{2w^2-1+\cos{\left[2(\pi-\theta)\right]}}\\
&=\int_{0}^{\pi/2}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}+\int_{\pi/2}^{0}\frac{-4w\,\mathrm{d}\theta}{2w^2-1+\cos{(2\pi-2\theta)}}\\
&=\int_{0}^{\pi/2}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}+\int_{0}^{\pi/2}\frac{4w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}\\
&=\int_{0}^{\pi/2}\frac{8w\,\mathrm{d}\theta}{2w^2-1+\cos{2\theta}}\\
\end{align}$$
A: Letting $u=\tan\dfrac{x}{2}$ gives some useful expressions for the other trigonometric ratios.
$$\sin x=\sin\left(2\times\frac{x}{2}\right)=2\sin\frac{x}{2}\cos\frac{x}{2}$$
$$\cos x=\cos\left(2\times\frac{x}{2}\right)=\cos^2\frac{x}{2}-\sin^2\frac{x}{2}$$
Considering drawing a reference triangle to write these expressions in terms of $u$.
A: This is a partial answer, assuming that $w>1$:
Let $u=\tan\left(\frac{\theta}{2}\right)$, so $\theta=2\arctan u$, $d\theta=\frac{2}{1+u^2}du$, $\sin\theta=\frac{2u}{1+u^2}$.
Then $\displaystyle\int\frac{d\theta}{w-\sin\theta}=\int\frac{1}{w-\frac{2u}{1+u^2}}\cdot\frac{2}{1+u^2}du=2\int\frac{1}{wu^2-2u+w}du$
$=\displaystyle\frac{2}{w}\int\frac{1}{u^2-\frac{2}{w}u+1}du=\frac{2}{w}\int\frac{1}{(u-\frac{1}{w})^2+(1-\frac{1}{w^2})}du$
$=\displaystyle\frac{2}{w}\left(\frac{1}{\frac{\sqrt{w^2-1}}{w}}\arctan\frac{u-\frac{1}{w}}{\frac{\sqrt{w^2-1}}{w}}\right)+C=\frac{2}{\sqrt{w^2-1}}\left(\arctan\frac{wu-1}{\sqrt{w^2-1}}\right)+C$.
Now since $u\rightarrow\pm\infty$ as $\theta\rightarrow\pm\pi$, we get
$\displaystyle\int_{-\pi}^{\pi}\frac{d\theta}{w-\sin\theta}=\frac{2}{\sqrt{w^2-1}}\left(\frac{\pi}{2}-(-\frac{\pi}{2})\right)=\frac{2\pi}{\sqrt{w^2-1}}$.
