Answer
$$\int x\sec^2 xdx=x\tan x+\ln|\cos x|+C$$
Work Step by Step
$$A=\int x\sec^2 xdx$$
Take $u=x$ and $dv=\sec^2xdx$
We then have $du=dx$ and $v=\tan x$
Apply the formula $\int udv= uv-\int vdu$, we have $$A=x\tan x-\int\tan xdx$$ $$A=x\tan x-\int\frac{\sin x}{\cos x}dx$$
Take $z=\cos x$, we then have $dz=-\sin xdx$, meaning that $\sin xdx=-dz$
That means $$A=x\tan x-\int\frac{-dz}{z}$$ $$A=x\tan x+\int\frac{1}{z}dz$$ $$A=x\tan x+\ln|z|+C$$
Now replace back $z$ with $\cos x$: $$A=x\tan x+\ln|\cos x|+C$$