# Method for finding non-obvious substitution in integration

To find the integral of the sec(x), you have to substitute a term that is not immediately obvious.

$$\int sec(x) dx = \int sec(x) \frac{sec(x)+tan(x)}{sec(x)+tan(x)} dx$$

$$u= sec(x)+tan(x)$$
$$du= (sec(x)tan(x)+sec^{2}(x))dx$$

$$\int sec(x) \frac{sec(x)+tan(x)}{sec(x)+tan(x)} dx = \int \frac{sec^{2}(x)+sec(x)tan(x)dx}{sec(x)+tan(x)} dx = \int \frac{du}{u} = ln |u| + C = ln |sec(x)+tan(x)| + C$$

My question is: What method is used to find this clever substitution term? All the online resources tell me what the term is, but not how they arrived at it. I understand that the goal is to eliminate the x variable and be left with u and du, but for some reason when I try to "reverse engineer" the process, I cannot arrive at u. I ask for a method that would work with other situations where a substitution term is not immediately obvious.

Thanks!

Last edited:

I'm not so sure there is an answer to that question. I think there is really no "method" for coming up with such a clever choice for an expression of 1 but that it was just that...a very clever choice that happens to work!

yep, calculus itself originated with trial and error, then come up with proofs to describe

Here's another method to do this integral which is a bit more obvious:
$$\int sec(x) dx =\int \frac{dx}{cos(x)} =\int \frac{cos(x) dx}{cos^{2}(x)}=\int \frac{cos(x) dx}{1-sin^{2}(x)}=\int \frac{d(sin(x))}{1-sin^{2}(x)}$$

Now let's use partial fractions on $$\frac{1}{1-sin^{2}(x)}$$, by letting $$\frac{1}{1-sin^{2}(x)}=\frac{A}{1+sin(x)}+\frac{B}{1-sin(x)}$$.

$$A(1-sin(x))+B(1+sin(x))=1$$, so $$(A+B)+(B-A)sin(x)$$ and $$A=B=\frac{1}{2}$$.

Thus we have $$\int sec(x) dx =\int (\frac{1}{2}\frac{d(sin(x))}{1+sin(x)}+\frac{1}{2}\frac{d(sin(x))}{1-sin(x)})=\int (\frac{1}{2}\frac{d(1+sin(x))}{1+sin(x)}-\frac{1}{2}\frac{d(1-sin(x))}{1-sin(x)})$$.

From there the problem is trivial.

Or substitute x = pi/2 - t so that you get the integral of 1/sin(t) and then a method analogous to what Lugita15 used is even simpler:

1/sin(t) = 1/[2 sin(t/2) cos(t/2)] =

[cos^2(t/2) + sin^2(t/2)]/[2 sin(t/2)cos(t/2)] =

1/2 [cot(t/2) + tan(t/2)]

which is trivial to integrate.

This is probably one of the sneakiest tricks I encountered when doing integrals (apparently wikipedia thinks integrating sec^3(x) is tricky - they devoted an entire article to that integral - but this feels way trickier). The particular multiplication by a factor that is equal to 1 does not seem to be the important point here. When I encountered this integral after having seen the trick once, I forgot the exact factor that was needed. But I remembered that really one of the main reasons for turning an integrand into an equivalent but more complicated fraction is to see if you can get the resulting numerator to be the derivative of the resulting denominator. If you succeed in doing this, you know that a particular antiderivative will basically be the natural log of that resulting denominator. I think keeping this general idea in mind is more important than its usefulness in this particular example. For instance, there are many integrals that seem to require the use of partial fractions, but if you can manipulate the integrand in the manner just described, you can make the problem a lot easier (especially if you hate dealing with partial fractions like I do).