The Integrand#=secx/(1+tan x)^2=(1/cosx)/((1+sinx/cosx)^2)#
#=(1/cosx)(cos^2x/(cosx+sinx)^2)=cosx/(cosx+sinx)^2#
Now, using Quotient Rule for Diffn., we have, #d/dx(1/(cosx+sinx))#
#={(cosx+sinx)d/dx(1)-1d/dx(cosx+sinx)}/(cosx+sinx)^2#
#=(sinx-cosx)/(cosx+sinx)^2#.
#rArr int(sinx-cosx)/(cosx+sinx)^2dx=1/(cosx+sinx)............(star)#
#I=intcosx/(cosx+sinx)^2dx=1/2int(2cosx)/(cosx+sinx)^2dx#
#=1/2int{(cosx+sinx)+(cosx-sinx)}/(cosx+sinx)^2dx#
#=1/2[int(cosx+sinx)/(cosx+sinx)^2dx+int(cosx-sinx)/(cosx+sinx)^2dx]#
#=1/2[int1/(cosx+sinx)dx-int(sin-cosx)/(cosx+sinx)^2dx]#
#=1/2[J-1/(cosx+sinx)]...........,[by (star)]#, where,
#J=int1/(cosx+sinx)dx#
Here, #cosx+sinx=sqrt2(1/sqrt2cosx+1/sqrt2sinx)=sqrt2cos(x-pi/4)#
#:. J =int1/(sqrt2cos(x-pi/4))dx=1/sqrt2intsec(x-pi/4)dx#
#=1/sqrt2ln|sec(x-pi/4)+tan(x-pi/4)|#.
Altogether,
#I=1/2[1/sqrt2ln|sec(x-pi/4)+tan(x-pi/4)|-1/(cosx+sinx)]+C#.
Enjoy Maths.!