Half-angle rewriting. Using cosx=cos22x−sin22x and 1−sinx=(cos2x−sin2x)2,
1−sinxcosx=(cos2x−sin2x)2(cos2x+sin2x)(cos2x−sin2x)=cos2x−sin2xcos2x+sin2x.
Dividing numerator and denominator by cos2x,
=1−tan2x1+tan2x=tan(4π+2x).
Unwrapping. Therefore
tan−1(1−sinxcosx)=tan−1(tan(4π+2x))=4π+2x.
Where the interval comes from. The last equality needs the angle 4π+2x to lie inside the principal value branch (−2π,2π) of tan−1:
−2π<4π+2x<2π ⟺ −43π<2x<4π ⟺ −23π<x<2π.
So the stated interval is not an arbitrary convenience; it is precisely the set on which the simplification is valid.
One point to check separately. The step of dividing by cos2x is not available at x=−π, where cos2x=0 and tan2x is undefined. Substituting directly there: cos(−π)=−1 and 1−sin(−π)=1, so the expression is tan−1(−1)=−4π, while 4π+2x=4π−2π=−4π. The result therefore holds at x=−π too, and the simplified form is valid on the whole of (−23π,2π).
What goes wrong outside it. At x=π the expression is tan−11−1=−4π, whereas 4π+2x=43π. The two differ by π — exactly the fold-back that the principal branch forces once the angle leaves (−2π,2π).