# How to solve $\int \tan^2(x) \sec (x) \ dx$? [duplicate]

How should one solve the following integral? $$\int \tan^2(x) \sec (x) \ dx$$

I can't think of any substitutions to be made involving $\tan^2(x)=\sec^2 (x)-1$ or $\sec^2(x)=\tan^2(x)+1$, which is how I've been solving most of the similar problems in my book until now. What should I do?

• Try to make substitution. Mar 3, 2015 at 21:45
• @Asker, what about integration by parts? Would it work? Mar 3, 2015 at 21:46
• @science When I substitute $u= \sec x$ then I end up with $\int \sqrt {u^2-1} \ du$, which I'm not sure how to integrate. Mar 3, 2015 at 21:47
• @Artem I thought of integrating by parts, but I stupidly missed the right parts! After giving it another try with the right ones, it worked out well- thanks! Mar 3, 2015 at 21:50
• Did you try searching ("integral tan sec", for example)? This was asked earlier today... Mar 3, 2015 at 23:09

Only by doing this in two harder ways did I catch a really nice trick for this problem in particular.

By doing $\tan^2(x)=\sec^2(x)-1$ we get

$$\int \sec(x) \tan^2(x) dx = \int \sec^3(x) dx - \int \sec(x) dx.$$

On the other hand, by integrating by parts with $dv=\sec(x) \tan(x) dx$ and $u=\tan(x)$, we get

$$\int \sec(x) \tan^2(x) dx = \sec(x) \tan(x) - \int \sec^3(x) dx.$$

$$2 \int \sec(x) \tan^2(x) dx = \sec(x) \tan(x) - \int \sec(x) dx.$$

So you just have to compute the last integral, which I will leave to you.

• +1 for adding the equations like that- fantastic solution. Mar 3, 2015 at 23:10

To build on Ian's answer, you may find it easier to integrate $2\sec^3(x)dx$ instead of just $\sec^3(x)dx$.

Hint as to why this might be easier: $\sec x\tan^2x$

• I think this answer would be more appropriate as a comment to Ian's answer. Mar 3, 2015 at 22:02
• unfortunately, I do not have enough reputation to comment on the posts of others. Mar 4, 2015 at 13:31
• Ah, that's a pity. I didn't remember that. Mar 4, 2015 at 14:38

In terms of sine and cosine you have $$\int \frac{\sin^2x}{\cos^3x}\,dx= \int\frac{\sin^2x}{(1-\sin^2x)^2}\cos x\,dx$$ With the substitution $t=\sin x$ the integral becomes (after splitting into partial fractions) $$\int\frac{t^2}{(1-t^2)^2}\,dt = \frac{1}{4}\int\left( \frac{1}{t-1}+\frac{1}{(t-1)^2}-\frac{1}{t+1}+\frac{1}{(t+1)^2} \right)\,dt$$ which is elementary.