# Evaluate an integral involving tangent and secant: $\int \tan^2x\sec^2x\,dx$

Evaluate $\displaystyle \int \tan^2x\sec^2x\,dx$

I tried several methods:

• First method was I changed $\tan^2x = \sec^2x-1$, and then substitute $\sec x$ to $t$, but it doesn't work.
• Second method was to use substitute $\tan^2x = v$, $\sec x = u$. And, it does not work as well.

Is there any better way to solve this problem?

$$I=\int\sec x\tan^2xdx\\=\int\sec x(\sec^2x-1)dx\\=\int\underbrace{\sec x}_{\mathtt u}.\underbrace{\sec^2x}_{\mathtt v}dx-\int\sec xdx\\=\left(\sec x\int\sec^2 xdx-\int (\sec x\tan x)\tan xdx\right)-\int\sec x$$ $$I=\sec x \tan x-\ln|\sec x+\tan x|-I+C$$ $$I=\frac12\left(\sec x\tan x-\ln\left|\sec x+\tan x\right|\right)+C$$