$$\sec ^2(x)=\tan ^2(x)+1$$ $$\csc ^2(x)=\cot ^2(x)+1$$
We can evaluate integrals of the form:
$$\int \sec ^m(x) \tan ^n(x) \, dx$$
$$\int \csc ^m(x) \cot ^n(x) \, dx$$
with substitution unless $m$ is odd and $n$ is even. What I am interested to know is why am I not able to solve this with substitution if $m$ is odd and $n$ is even. I am aware that I can solve it by integration by parts. But I do not see the underlying reason for why it is not possible when using substitution?
What if $m$ is odd, $n$ is even. For example, $m=1, n=0$.
$$ \int \sec x\;dx $$ Proceed as the method says. Keep $\sec^2$ and use a pythagorean identity to convert all the rest to $\tan$ ... even if you don't see two secants, you can still do it: $$ \int \sec x\;dx = \int \frac{\sec^2 x}{\sec x}\;dx = \int\frac{\sec^2 x}{\sqrt{1+\tan^2 x}} \;dx $$ then substitute $u = \tan x$ to get $$ \int \frac{du}{\sqrt{1+u^2}} $$ Then do this one "somehow" and substitute back $$ \int \frac{du}{\sqrt{1+u^2}} = \log\big(u+\sqrt{1+u^2}\;\big) + C =\log\big(\tan x + \sqrt{\sec^2 x}\;\big)+ C = \log(\tan x \pm \sec x) + C $$
The difference in these cases ($n$ even and $m$ odd) is that you do not end up with a rational function of $u$ to integrate. You have a square root.