Let us consider the problem:
tan−1(cosx1−sinx)=tan−1⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜⎝1−tan2x21+tan2x21−2tanx21+tan2x2⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟⎠
Implies that
=tan−1⎛⎜ ⎜⎝1−tan2x21+tan2x2−2tanx2⎞⎟ ⎟⎠
Implies that
=tan−1⎛⎜ ⎜ ⎜ ⎜ ⎜⎝(1+tanx2)(1−tanx2)(1−tanx2)2⎞⎟ ⎟ ⎟ ⎟ ⎟⎠
Implies that
=tan−1⎛⎜ ⎜⎝1+tanx21−tanx2⎞⎟ ⎟⎠
Implies that
=tan−1⎛⎜ ⎜⎝tanπ4+tanx21−tanπ4tanx2⎞⎟ ⎟⎠
Implies that
=tan−1(tan(π4+x2))
Hence,
=π4+x2