<s>[INST] Evaluating a trigonometric integral using residues Finding the trigonometric integral using the method for residues:
$$\int_0^{2\pi} \frac{d\theta}{ a^2\sin^2 \theta + b^2\cos^2 \theta} = \frac{2\pi}{ab}$$ where $a, b > 0$.
I can't seem to factor this question
I got up to  $4/i (z) / ((b^2)(z^2 + 1)^2 - a^2(z^2 - 1)^2 $
I think I should be pulling out $a^2$ and $b^2$ out earlier but not too sure how.
 [/INST] Without residues and same dirty trigonometric trick as before:
$$\frac{1}{a^2\sin^2t+b^2\cos^2t}=\frac{1}{b^2\cos^2t}\frac{1}{1+\frac{a^2}{b^2}\tan^2t}=\frac{1}{ab}\frac{\frac{a}{b\cos^2t}}{1+\left(\frac{a}{b}\tan t\right)^2}$$
and since 
$$\frac{a}{b\cos^2t}=\left(\frac{a}{b}\tan t\right)'$$
we finally get:
$$\int\limits_0^{2\pi}\frac{dt}{a^2\sin^2t+b^2\cos^2t}=2\int\limits_{-\pi/2}^{\pi/2}\frac{dt}{a^2\sin^2t+b^2\cos^2t}=\left.\frac{2}{ab}\arctan\frac{a}{b}\tan t\right|_{-\pi/2}^{\pi/2}=\frac{2\pi}{ab}$$
</s>