integrate (cos x - sin x)/(1 + sin 2x) dx

Given:
An integral
[tex]\int\frac{Cosx-Sinx}{1+sin2x}dx[/tex]Required:
Solve the integral.
Explanation:
We will start with
[tex]\begin{gathered} 1+Sin2x=Sin^2x+Cos^2x+2SinxCosx \\ 1+Sin^2x=(Sinx+Cosx)^2 \end{gathered}[/tex]Now,
[tex]=\int\frac{Cosx-Sinx}{(Cosx+Sinx)^2}dx[/tex]Put
[tex]\begin{gathered} Cosx+Sinx=t \\ dt=(Cosx-Sinx)dx \end{gathered}[/tex][tex]\begin{gathered} =\int\frac{dt}{t^2} \\ =\frac{t^{-2+1}}{-2+1}+c \\ =\frac{t^{-1}}{-1}+c \\ =-\frac{1}{t}+c \\ =-\frac{1}{Cosx+Sinx}+c \end{gathered}[/tex]Answer:
Hence, above is the answer.