Consider the given integral.
I=∫(cosx−sinx)tan−1(sinx+cosx)(2+sin2x)dx
Let t=tan−1(sinx+cosx)
dtdx=11+(sinx+cosx)2(cosx−sinx)
dtdx=(cosx−sinx)1+(sin2x+cos2x+2sinxcosx)
dt=(cosx−sinx)2+sin2xdx
Therefore,
I=∫tdt
I=t22+C
On putting the value of t, we get
I=(tan−1(sinx+cosx))22+C
Hence, this is the answer.