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 ?

**Answer**

Many otherwise-mysterious tricks in integrals involving trigonometric functions can be explained by expressing the trig functions in terms of exponentials, as in $\cos(x)=(e^{ix}+e^{-ix})/2$. The resulting rational expressions in exponentials can always be integrated…

EDIT: to explain why/how rational expressions on $e^{ix}$ can always be integrated: for example,

$$

\int {1\over 1+e^{ix}} \, dx

\;=\;

-i \int {1\over e^{ix}(1+e^{ix})}\;d(e^{ix})

\;=\;

-i \int {1\over t(1+t)}\;dt

$$

with $t=e^{ix}$. Then use partial fractions to break this up into easily-computable pieces.

Once I learned this, years ago, I mostly lost interest in the tricks, because equivalents of them can be recovered by using exponentials and complex numbers. No guessing is necessary.

Nevertheless, historically, I’m fully confident that people did just experiment endlessly until they found a trick to be able to compute a given indefinite integral, and then that trick was passed on to subsequent generations. In particular, if we do look at it that way, there’s no real way that one can “anticipate” the necessary tricks…

**Attribution***Source : Link , Question Author : HarshDarji , Answer Author : Michael Hardy*