Fiding $\int_0^{2\pi}\frac{\mathrm{d}x}{4\cos^2x+\sin^2x}$ I was checking some old complex analysis homework and I found the following  definite integral $$\int_0^{2\pi}\frac{\mathrm{d}x}{4\cos^2x+\sin^2x},$$
had to be found with the residue theorem. Back at the time I thought it was trivial, however I'm trying to do it, but I have no idea on how to star. Could anyone please give me a hint on how to start? 
Thanks.
 A: Hint: Let $z=e^{i x}$; $dx=-i dz/z$; $\cos{x}=(z+z^{-1})/2$.  The integral is then equal to
$$-i \oint_{|z|=1} \frac{dz}{z} \frac{1}{1+\frac{3}{4} (z+z^{-1})^2} $$
Multiply out, determine the poles, figure out which poles, if any, lie within the unit circle, find the residues of those poles, multiply the sum of those residues (there may only be one, or none) by $i 2 \pi$, and you are done.
A: HINT:
Without using Complex Calculus, divide the numerator & the denominator by $\cos^2x$ and substitute $\tan x$ with $u$
A: You can also replace the quadratic trig terms with the double angle formula involving $cos2x$ Your denominator then will consists of a constant and a $cos2x$ term. Then sub away $2x=v$ and then use the Weierstrass substitution converting the integral into a rational function. This is hilarious of course, but what the heck?
A: 
if you fcator 4cos^2x from  4cos^2x+sin^2x
you will have an arctan form integral
at the end 
note that period of the function is pi
so your problem reduce to 4*integral(0 -->pi/2) f(x)
