Period of nonuniform oscillator by Jacob Harris

Show that $\int_{-\pi}^{\pi}\frac{d\theta}{\omega-a\sin(\theta)} = \frac{2\pi}{\sqrt{{\omega}^{2}-{a}^{2}}}.$

Let $u=\tan(\frac{\theta}{2})$.

$\rightarrow u(-\pi) = -\infty, u(\pi) = \infty$

$\rightarrow \theta=2\arctan(u)$

$\rightarrow d\theta=\frac{2du}{1+u^2}$

$\rightarrow \tan(\theta) = \tan(2\arctan(u)) = \frac{2\tan(\arctan(u))}{1-{{\tan}^{2}(\arctan(u))}} = \frac{2u}{1-{u}^{2}} = \frac{\rm {opp}}{\rm {adj}}$

$\rightarrow {\rm {opp}}^{2}+{\rm {adj}}^{2} = 4{u}^2+1-2{u}^2+{u}^4 = 1+2{u}^2+{u}^4 = {\rm {hyp}}^{2}$

$\rightarrow \rm {hyp} = 1+{u}^2$

$\rightarrow \sin(\theta) = \frac{\rm {opp}}{\rm {hyp}} = \frac{2u}{1+{u}^2}$

The integral becomes

$\int_{-\infty}^{\infty}\frac{2du}{(1+u^2)(\omega-a\frac{2u}{1+{u}^2})} = 2\int_{-\infty}^{\infty}\frac{du}{\omega+\omega{u}^2-2au}$

$= \frac{2}{\omega}\int_{-\infty}^{\infty}\frac{du}{{u}^2-\frac{2a}{\omega}u+1}$

$= \frac{2}{\omega}\int_{-\infty}^{\infty}\frac{du}{{u}^2-\frac{2a}{\omega}u+\frac{a^2}{\omega^2}+1-\frac{a^2}{\omega^2}}$

$= \frac{2}{\omega}\int_{-\infty}^{\infty}\frac{du}{{({u}-\frac{a}{\omega})}^{2}+1-\frac{a^2}{\omega^2}}$

Let $x = {u}-\frac{a}{\omega}$.

$\rightarrow dx = du$

$\rightarrow x(-\infty) = -\infty, x(\infty) = \infty$

The integral becomes

$\frac{2}{\omega}\int_{-\infty}^{\infty}\frac{dx}{{x}^{2}+1-\frac{a^2}{\omega^2}}$

Let $x = \sqrt{r}\tan(y)$, with $r=1-\frac{a^2}{\omega^2}$.

$\rightarrow y = \arctan(\frac{x}{\sqrt{r}})$.

$\rightarrow dx = \sqrt{r}\sec^{2}(y)dy$.

$\rightarrow y(-\infty) = -\pi/2, y(\infty) = \pi/2$

The integral becomes

$\displaystyle \frac{2}{\omega}\int_{-\pi/2}^{\pi/2}\frac{\sqrt{r}\sec^{2}(y)dy}{{r}^{2}{\tan(y)}^{2}+r^2}$      
$\displaystyle =\frac{2}{\omega}\int_{-\pi/2}^{\pi/2}\frac{\sec^{2}(y)dy}{\sqrt{r}({\tan(y)}^{2}+1)}$      
$\displaystyle =\frac{2}{\omega}\int_{-\pi/2}^{\pi/2}\frac{\sec^{2}(y)dy}{\sqrt{r}{\sec}^{2}(y)}$      
$\displaystyle =\frac{2}{\omega}\int_{-\pi/2}^{\pi/2}\frac{dy}{\sqrt{r}}$      
$\displaystyle =\frac{2}{\omega\sqrt{1-\frac{a^2}{\omega^2}}}{(y)}\vert _{-\pi/2}^{\pi/2}$      
$\displaystyle =\frac{2\pi}{\sqrt{{\omega}^{2}-{a}^{2}}}$