Solution:
Key idea: The fraction 1+tan2x1−tan2x is the standard form of cos2x. Then cos−1(cosθ)=θ holds only when θ lies in the principal range 0≤θ≤π of cos−1. C is the constant of integration.
Step 1 — Simplify the fraction.
We write tanx=cosxsinx and multiply the numerator and the denominator by cos2x.
1+tan2x1−tan2x=cos2x+sin2xcos2x−sin2x
1+tan2x1−tan2x=cos2x
Step 2 — Remove the inverse function.
We need 0≤2x≤π; together with tanx being defined, this means 0≤x<2π. On this interval the inverse undoes the cosine.
cos−1(cos2x)=2x
Step 3 — Integrate.
We use the power rule with n=1.
∫2xdx=2⋅2x2+C
∫2xdx=x2+C
Note: For −2π<x<0 the angle 2x is negative, so cos−1(cos2x)=−2x and the integral there is −x2+C.
Therefore, ∫cos−1(1+tan2x1−tan2x)dx=x2+C for 0≤x<2π.