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