Answer
$$x\left( {\tan x - x} \right) + \ln \left| {\cos x} \right| + \frac{{{x^2}}}{2} + C$$
Work Step by Step
$$\eqalign{
& \int {x{{\tan }^2}x} dx \cr
& {\text{identity 1 + ta}}{{\text{n}}^2}x = {\sec ^2}x \cr
& = \int {x\left( {{{\sec }^2}x - 1} \right)} dx \cr
& \cr
& {\text{substitute }}u = x,{\text{ }}du = dx \cr
& dv = \left( {{{\sec }^2}x - 1} \right)dx,{\text{ }} \cr
& v = \int {\left( {{{\sec }^2}x - 1} \right)dx} \cr
& v = \tan x - x \cr
& {\text{ integration by parts}} \cr
& \int {udv} = uv - \int {vdu} \cr
& {\text{, we have}} \cr
& = x\left( {\tan x - x} \right) - \int {\left( {\tan x - x} \right)dx} \cr
& = x\left( {\tan x - x} \right) - \int {\tan xdx} + \int x dx \cr
& {\text{trigonometric identity }}\tan x = \frac{{\sin x}}{{\cos x}} \cr
& = x\left( {\tan x - x} \right) - \int {\frac{{\sin x}}{{\cos x}}dx} + \int x dx \cr
& = x\left( {\tan x - x} \right) + \int {\frac{{ - \sin x}}{{\cos x}}dx} + \int x dx \cr
& {\text{find antiderivative}} \cr
& = x\left( {\tan x - x} \right) + \ln \left| {\cos x} \right| + \frac{{{x^2}}}{2} + C \cr} $$