The expression to be integrate is given below as,
I= ∫ dx 1−tanx
Simplify the above integral,
I= ∫ dx 1−tanx = ∫ dx 1− sinx cosx = ∫ cosxdx cosx−sinx
Simplify further,
I= 1 2 ∫ 2cosxdx cosx−sinx = 1 2 ∫ ( cosx−sinx )+( cosx+sinx ) cosx−sinx dx = 1 2 ∫ dx + 1 2 ∫ cosx+sinx cosx−sinx dx = x 2 + C 1 + I 1 (1)
Let I 1 = ∫ cosx+sinx cosx−sinx dx
Put cosx−sinx=t
Differentiate with respect to t.
( −sinx−cosx )dx=dt ( sinx+cosx )dx=−dt
Substitute the value in I 1 .
I 1 = 1 2 ∫ cosx+sinx cosx−sinx dx = 1 2 ∫ −dt t =− 1 2 log| t |+ C 2 =− 1 2 log| cosx−sinx |+ C 2
By substituting value of I 1 in equation (1), we get
I= x 2 + C 1 − 1 2 log| cosx−sinx |+ C 2 = x 2 − 1 2 log| cosx−sinx |+C