How can I evaluate the following integral? $$ \int\frac{\cos{x}}{1+\sin{2x}} dx $$
I tried the following way, but I was not able to proceed further: $$ \begin{gather} I&=\int\frac{\cos{x}}{\left(\sin{x}+\cos{x}\right)^2} dx\\ &= \int\frac{\sec{x}}{\left(1+\tan{x}\right)^2} dx \end{gather} $$
Hint:
Write numerator as $$2\cos x=\cos x+\sin x +(\cos x-\sin x)$$