
How do they know that taking x = tan theta will solve the problem? I have seen such assumption in many question, in some they take x = sec theta etc. How to determine the x which will solve the problem easily?

How do they know that taking x = tan theta will solve the problem? I have seen such assumption in many question, in some they take x = sec theta etc. How to determine the x which will solve the problem easily?
The idea of this change of variable can result from a form of "pattern matching":
When I see such a formula with $\tan^{-1}$ of a certain expression containing in particular a subexpression $1+x^2$. As I know by heart a certain number of trigonometrical formulas, among them $1+\tan^2 \theta=\tfrac{1}{cos^2 \theta}$, I do the "matching" (i.e., I make the corresponding change of variables) guided by the fact that a single term is better than two, but "triggered" by the supplementary fact that there is a square root that can be suppressed doing that.