Since this has nothing to do with "differential equations", I am moving it to "Caclulus and Analysis".
Splint, each integral situation is different and it is hard to give very general rules for substiutions.
tan(x)= sin(x)/cos(x) so to integrate tan(x) is to differentiate sin(x)/cos(x):
[tex]\int\frac{sin(x)}{cos(x)} dx[/tex]
I have, really, only a few possible substitutions: If I let u= sin(x), say, I get du= cos(x)dx but now I have a problem- the "cos(x)" in my problem is in the denominator not the numerator and so is not multiplying dx. But, in fact, I could use that substitution! Since I need "cos(x)dx", multiply both numerator and denominator by cos(x):
[tex]\int \frac{sin(x)}{cos(x)}\frac{cos(x)}{cos(x)}dx= \int\frac{sin(x)}{cos^2(x)}cos(x)dx[/tex]
[tex]= \int\frac{sin(x)}{1- sin^2(x)}cos(x)dx= \int\frac{u}{1- u^2}du[/tex]
which I could now do by "partial fraction".
But the "u= cos(x)" makes the problem much easier. If u= cos(x), du= -sin(x)dx so we have immediately
[tex]\int \frac{sin(x)}{cos(x)}dx= -\int\frac{sin(x)dx}{cos(x)}= -\int\frac{du}{u}[/tex]
Why don't you try integrating
[tex]\int\frac{u}{1- u^2}du= -\frac{1}{2}\left(\int\frac{du}{u-1}+ \int\frac{1}{u+1}du\right)[/tex]
and see if you don't get the same thing?
The fact is that much of "substitution" in integrals is "trial and error"- you try some substitution and see if it works.