Integrate the function.
∫xsec2xdx.
Let I=∫xsec2xdx.
On taking x as first function and sec2 x as second function and integrating by parts, we get
I=x∫sec2xdx−∫[ddx(x)∫sec2xdx]dx
=xtanx−∫tanxdx=xtanx−log|secx|+C⇒I=xtanx+log|cosx|+C[log|secx|=log∣∣1cosx∣∣=log1−log|cosx|=−log|cosx|(∵log=0)]