Let I=∫dx1−cosx−sinx
=∫dxcosx+sinx−1
=−∫dx1−tan2x21+tan2x2+2tanx21+tan2x2−1
=−∫dx1−tan2x2+2tanx2−1−tan2x21+tan2x2
=−∫1+tan2x2dx−2tan2x2+2tan2x2
Let tanx2=u ⇒12sec2x2dx=du
So, by replacing the values we get
I=12∫sec2x2dxtanx22−tanx2
=∫duu2−u
=∫1(1−1u)u2du
Let t=1−1u,dtdu=1u2
I=−∫1tdt
=ln(t)+c
=ln(1−1u)+c
=ln⎛⎜
⎜⎝1−1tanx2⎞⎟
⎟⎠+c