We are asked to evaluate:
\[
\int x \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right) \, dx
\]
Step 1: Recognize inverse trigonometric identity
We know:
\[
\frac{1-x^2}{1+x^2} = \cos 2\theta
\]
So,
\[
2\theta = \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right)
\]
Then,
\[
\theta = \frac{1}{2} \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right)
\]
And also, we know:
\[
\tan \theta = x
\]
Step 2: Use integration by parts
Let
\[
I = \int x \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right) \, dx
\]
Let
\[
u = \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right), \, dv = x\,dx
\]
Then,
\[
du = \frac{4x}{(1+x^2)^2 \sqrt{1 - \left(\frac{1-x^2}{1+x^2}\right)^2}} \, dx
\]
But easier via substitution:
\[
\text{Since } \frac{1-x^2}{1+x^2} = \cos 2 \theta, \text{ so } 2 \theta = \cos^{-1}\left(\frac{1-x^2}{1+x^2}\right)
\]
\[
\text{And } \tan \theta = x
\]
\[
\Rightarrow \theta = \tan^{-1} x
\]
Therefore,
\[
\cos^{-1}\left(\frac{1-x^2}{1+x^2}\right) = 2 \tan^{-1} x
\]
Step 3: Substitute back
Now,
\[
I = \int x \times 2 \tan^{-1} x \, dx
\]
\[
= 2 \int x \tan^{-1} x \, dx
\]
Step 4: Apply integration by parts again
Let
\[
u = \tan^{-1} x, \, dv = x\,dx
\]
Then,
\[
du = \frac{1}{1+x^2} \, dx, \, v = \frac{x^2}{2}
\]
Now,
\[
I = 2 \left( \frac{x^2}{2} \tan^{-1} x - \int \frac{x^2}{2} \times \frac{1}{1+x^2} \, dx \right)
\]
\[
= 2 \left( \frac{x^2}{2} \tan^{-1} x - \frac{1}{2} \int \frac{x^2}{1+x^2} \, dx \right)
\]
Step 5: Simplify integral
\[
\int \frac{x^2}{1+x^2} \, dx = \int \left(1 - \frac{1}{1+x^2}\right) \, dx
\]
\[
= x - \tan^{-1} x
\]
Step 6: Final substitution
Now,
\[
I = 2 \left( \frac{x^2}{2} \tan^{-1} x - \frac{1}{2} (x - \tan^{-1} x) \right)
\]
\[
= x^2 \tan^{-1} x - (x - \tan^{-1} x)
\]
\[
= (x^2 + 1) \tan^{-1} x - x
\]
Finally,
\[
\boxed{I = -x + (1 + x^2) \tan^{-1} x + c}
\]