Solution:
Key idea: We use tan2x=sec2x−1 to split the integral, and integrate xsec2x by parts, ∫uvdx=u∫vdx−∫(dxdu∫vdx)dx, with u=x.
Step 1 — Split.
We replace tan2x and split into two integrals.
I=∫x(sec2x−1)dx
I=∫xsec2xdx−∫xdx
Step 2 — Integrate xsec2x by parts.
We take u=x and v=sec2x, with ∫sec2xdx=tanx and ∫tanxdx=log∣secx∣.
∫xsec2xdx=xtanx−∫tanxdx
∫xsec2xdx=xtanx−log∣secx∣
Step 3 — Combine.
We subtract ∫xdx=2x2 and add the constant.
I=xtanx−log∣secx∣−2x2+C
Therefore, ∫xtan2xdx=xtanx−log∣secx∣−2x2+C, wherever cosx=0.