We know that
2tan−1x=cos−1(1−x21+x2)
tan−1x=12cos−1(1−x21+x2)
Replace x with (√a−ba+btanx2)
tan−1(√a−ba+btanx2)=12cos−1⎛⎜
⎜
⎜
⎜
⎜⎝1−(√a−ba+btanx2)21+(√a−ba+btanx2)2⎞⎟
⎟
⎟
⎟
⎟⎠
tan−1(√a−ba+btanx2)=12cos−1⎛⎜
⎜
⎜
⎜⎝1−(a−ba+btan2x2)1+(a−ba+btan2x2)⎞⎟
⎟
⎟
⎟⎠
tan−1(√a−ba+btanx2)=12cos−1⎛⎜
⎜
⎜
⎜⎝(a+b)−((a−b)tan2x2)(a+b)+((a−b)tan2x2)⎞⎟
⎟
⎟
⎟⎠
tan−1(√a−ba+btanx2)=12cos−1⎛⎜
⎜⎝a+b−atan2x2+btan2x2a+b+atan2x2−btan2x2⎞⎟
⎟⎠
tan−1(√a−ba+btanx2)=12cos−1⎛⎜
⎜
⎜
⎜
⎜
⎜
⎜
⎜
⎜
⎜
⎜⎝a⎛⎜
⎜⎝1−tan2x21+tan2x2⎞⎟
⎟⎠+ba+b⎛⎜
⎜⎝1−tan2x21+tan2x2⎞⎟
⎟⎠⎞⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟⎠
We know that
1−tan2x21+tan2x2=cosx
tan−1(√a−ba+btanx2)=12cos−1(acosx+ba+bcosx)