Answer
$$\int\sec x\tan^2xdx=\frac{1}{2}\sec x\tan x-\frac{1}{2}\ln|\sec x+\tan x|+C$$
Work Step by Step
$$A=\int\sec x\tan^2xdx$$ $$A=\int\sec x(\sec^2x-1)dx$$ $$A=\int\sec^3xdx-\int\sec xdx$$ $$A=I-\ln|\sec x+\tan x|$$
So we have $$I=\int\sec^3xdx$$
To calculate $I$, we use Integration by Parts method.
Set $u=\sec x$ and $dv=\sec^2xdx$
That means $du=\sec x\tan xdx$ and $v=\tan x$
Therefore, $$I=\sec x\tan x-\int\sec x\tan^2xdx$$
Now apply this back to $A$:
$$A=\sec x\tan x-\int\sec x\tan^2xdx-\ln|\sec x+\tan x|$$
We see that the integral $\int\sec x\tan^2xdx$ is exactly the given problem, so
$$A=\sec x\tan x-A-\ln|\sec x+\tan x|$$ $$2A=\sec x\tan x-\ln|\sec x+\tan x|+C$$ $$A=\frac{1}{2}\sec x\tan x-\frac{1}{2}\ln|\sec x+\tan x|+C$$