I am going to take a very simple example to elaborate my question.
When we integrate $\sec (x)\,dx$ we divide and multiply by $\sec (x) + \tan (x)$.
$$\int \sec(x)\,dx = \int \sec (x) \left[{\sec (x) + \tan (x) \over \sec (x) + \tan (x)}\right]\, dx$$
I am just solving from here.
$$\int {\sec^2(x) + \sec(x)\tan(x) \over \sec(x) + \tan(x)} \, dx $$
Then we let $\sec(x) + \tan(x) = u$
$$\implies du = (\sec^2(x) + \sec(x)\tan(x))\,dx$$
$$\implies \int {du \over u}$$
$$= \ln{\left|\sec(x) + \tan(x)\right|} + c$$
Now coming to my questions.
Why do we HAVE to make that manipulation of multiplying $\sec(x) + \tan(x)$. Like I know its to get the answer...but why does it work so well?
How to even think like that? Like "if I multiply $\sec(x) + \tan(x)$ in the numerator and denominator then I'll be able to solve this very easily." What in that integral gives one direction to think of such a manipulation ?