# Need help with an Improper integral

I need to evaluate

$$\int_0^{2\pi}\frac{d\theta}{a+\sin^2\theta}.$$

I immediately noticed how this is an integral of the form $$\int_0^{2\pi} f(\cos(\theta),\sin(\theta))d\theta$$. I first tried to choose a closed contour in $$\mathbb C$$ and a related integrand such that $$z(\theta) = e^{i\theta}$$ with $$0<\theta<2\pi$$, but I am not really sure how to proceed with the function

$$h(\theta) = a + \sin^2\theta$$

so that I can evaluate such a closed contour with the Residue Theorem for the contour integral.

• Are you only interested in contour solutions? If so, try $z=\exp i\theta$; but if you'd like to try another option, replace $\int_0^{2\pi}$ with $4\int_0^{\pi/2}$, then take $t=\tan\theta$. – J.G. Apr 21 at 18:39

Hint: Use the so-called Weierstrass substitution: $$\sin(x)=\frac{2t}{1+t^2}$$ and $$dx=\frac{2dt}{1+t^2}$$
Hint: $$\frac{1}{a+\sin^2(\theta)}=\frac{\sec^2 \theta}{a+(a+1)\tan^2(\theta)}$$