Key idea: The expression 1+x1−x suggests x=cos2θ, because 1−cos2θ=2sin2θ and 1+cos2θ=2cos2θ. This makes tan−11+x1−x equal to 21cos−1x, which we then integrate by parts.
Step 1 — Simplify the integrand with x = cos 2θ.
Let x=cos2θ with 0≤θ<2π (this covers −1<x≤1, where the integrand is defined). Then tanθ≥0.
1+x1−x=1+cos2θ1−cos2θ
1+x1−x=2cos2θ2sin2θ
1+x1−x=tanθ
Step 2 — Express the integrand in x.
Since θ lies in the principal range of tan−1, tan−1(tanθ)=θ; also, from x=cos2θ, we have 2θ=cos−1x.
tan−11+x1−x=θ
tan−11+x1−x=21cos−1x
So the integral becomes I=21∫cos−1xdx.
Step 3 — Integrate cos⁻¹ x by parts.
We take u=cos−1x and dv=dx, so du=−1−x2dx, and v=x.
∫cos−1xdx=xcos−1x+∫1−x2xdx
Step 4 — Finish the remaining integral.
Put s=1−x2, so ds=−2xdx. This means xdx=−2ds.
∫1−x2xdx=−21∫s−1/2ds
∫1−x2xdx=−1−x2
Step 5 — Combine and multiply by one half.
We put this back into Step 3 and multiply the whole result by 21.