<s>[INST] How to evaluate $\int^{2\pi}_0\frac{d\theta}{b^2\cos^2\theta + a^2 \sin^2\theta}$ for $a>0$ and $b>0$ 
How to evaluate $\int^{2\pi}_{0}\frac{d\theta}{b^2\cos^2\theta+a^2\sin^2\theta}$ for $a,b>0$

I came across this integral while solving a line integral problem . but it doesn't looks easier to integrate . I tried substitution of $\tan x$ .but i'm not sure tan can be used as the tan is discontinuous at $\pi/2$ i tried other substitution but none of them work.
 [/INST] Your method works. We have
$$\begin{align*}
\int^{2\pi}_{0}\frac{\mathrm d\theta}{b^2\cos^2\theta+a^2\sin^2\theta}&=4\int^{\frac\pi 2}_{0}\frac{\mathrm d\theta}{b^2\cos^2\theta+a^2\sin^2\theta}\\&=4\int^{\frac\pi 2}_{0}\frac{\sec^2 \theta\mathrm d\theta}{b^2+a^2\tan^2\theta}\\
&=4\int^{\infty}_{0}\frac{\mathrm du}{b^2+a^2u^2}\\&=\frac4{ab}\arctan\left(\frac{au}{b}\right)\Big|^\infty_0\\&=\frac{2\pi} {ab}.
\end{align*}$$ Here's an another approach. We have
$$\begin{align*}
\int^{2\pi}_{0}\frac{\mathrm d\theta}{b^2\cos^2\theta+a^2\sin^2\theta}&=\int^{2\pi}_{0}\frac{\mathrm d\theta}{\frac{a^2+b^2}2+\frac{b^2-a^2}2\cos(2\theta)}\\&=\int^{2\pi}_{0}\frac{\mathrm d\theta}{\frac{a^2+b^2}2+\frac{b^2-a^2}2\cos\theta}\\
&=\frac{2\pi}{\sqrt{\left(\frac{a^2+b^2}2\right)^2-\left(\frac{b^2-a^2}2\right)^2}}\\
&=\frac{2 \pi}{ab}.
\end{align*}$$ Here, $$
\int^{2\pi}_{0}\frac{\mathrm d\theta}{\alpha+\beta\cos\theta}=\frac{2\pi}{\sqrt{\alpha^2-\beta^2}}, \quad \alpha>|\beta|\tag{*}
$$ is used. (See, for example, this earlier post. The first approach can be seen as a way of showing the integral $(*)$.)
</s>