Solution:
Key idea: We put x=tanθ, which turns 1+x21−x2 into cos2θ. For x≥0 we have 0≤θ<2π, so 2θ lies in [0,π) and cos−1(cos2θ)=2θ. Then ∫tan−1xdx is found by parts, ∫uvdx=u∫vdx−∫(dxdu∫vdx)dx.
Step 1 — Simplify the integrand.
With x=tanθ, we use cos2θ=1+tan2θ1−tan2θ.
cos−1(1+x21−x2)=cos−1(cos2θ)
cos−1(1+x21−x2)=2θ
cos−1(1+x21−x2)=2tan−1x
So the integral becomes:
I=2∫tan−1xdx
Step 2 — Integrate tan−1x by parts.
We write tan−1x⋅1, with u=tan−1x, dxdu=1+x21 and ∫1dx=x.
∫tan−1xdx=xtan−1x−∫1+x2xdx
∫tan−1xdx=xtan−1x−21log(1+x2)
Step 3 — Double it.
We multiply by 2 and add the constant.
I=2xtan−1x−log(1+x2)+C
Watch out: For x<0 the integrand equals −2tan−1x, so the answer there is −2xtan−1x+log(1+x2)+C.
Therefore, ∫cos−1(1+x21−x2)dx=2xtan−1x−log(1+x2)+C for x≥0.