Answer
$x\displaystyle \tan x-\ln|\sec x|-\frac{1}{2}x^{2}+C$
Work Step by Step
Use the identity $\tan^{2}x+1=\sec^{2}x$
$I= \displaystyle \int x\tan^{2}xdx=\int x(\sec^{2}x-1)dx$
$=\displaystyle \int x\sec^{2}xdx-\int xdx$
We solve the first integral by parts
$\left[\begin{array}{ll}
du=dx & dv=\sec^{2}xdx\\
u=x & v=\tan x
\end{array}\right]$ ,$\displaystyle \quad \int udv=uv-\int vdu$
$I=x\displaystyle \tan x-\int\tan xdx-\frac{1}{2}x^{2}$
$=x\displaystyle \tan x-\ln|\sec x|-\frac{1}{2}x^{2}+C$