I try to to solve following definite integration
$$\int_{0}^{2\pi} \frac{\sqrt{1-\sin2x\sin2\phi}\cos\phi}{-1+a^{2}\sin^{2}(x-\phi)+\sin2x\sin2\phi} d\phi$$
first i use $z=e^{i \phi}$
from this,$$ d\phi=-i\frac{dz}{z},\quad \sin\phi=\frac{z-z^{-1}}{2i},\quad \cos\phi=\frac{z+z^{-1}}{2}$$
then integral becomes $$\oint\frac{-i2(z^{2}+1)\sqrt{1+i\frac{z^{4}-1}{2z^{2}}\sin2x}dz}{-4z^{2}+a^{2}(-z^{4}e^{-2ix}-e^{2ix}+2z^{2})-2iz^{4}\sin2x +2i\sin2x}$$
with the path of integration the unit circle. denominator have 4 roots which 2 of them is bigger than unit for all a and x and the others is little than one then i use residue theorem to solve the this integral. But I'll come across a question here, How to deal with a radical function on the numerator$(\sqrt{1+i\sin2x\frac{z^{4}-1}{2z^{2}}})$. Can i simplify it as follows, $$\sqrt{1+i\frac{z^{4}-1}{2z^{2}}\sin2x}=\frac{\sqrt{z^{2}+i\frac{z^{4}-1}{2}\sin2x}}{z}$$ Or should $z^{2}$ be in radical. if i take out $z^{2}$ from radical denominator has 5 roots (5th is z=0) and this change result. dose this integral be solved by the residue theorem approach?