Evaluating $\int_{-1/2}^{1} \cos^{-1} \frac{1-x^2}{1+x^2} dx$ Let us do the integration by parts  $$I=\int_{-1/2}^{1} ~\cos^{-1} \frac{1-x^2}{1+x^2}. 1~ dx =\left.x \cos^{-1} \frac{1-x^2}{1+x^2}\right|_{-1/2}^{1}-\int_{-1/2}^{1} \frac{2x}{1+x^2} dx$$ $$=\frac{\pi}{2}+\frac{1}{2}\cos^{-1} \frac{3}{5}-\left .\ln(1+x^2)\right|_{-1/2}^{1}=\frac{\pi}{2}+\frac{1}{2}\cos^{-1} \frac{3}{5}-\ln\frac{8}{5}.$$
The question is whether something is amiss here and whether the answer is right.
EDit
The correct answer is $$I=\frac{\pi}{2}+\frac{1}{2}\cos^{-1} \frac{3}{5}-\ln\frac{5}{2}.$$

Set $\tan^{-1}x=y, -\dfrac\pi2<y<\dfrac\pi2\iff-\pi<2y\le\pi $
$$\cos^{-1}\dfrac{1-x^2}{1+x^2}=\cos^{-1}(\cos2y)=\begin{cases}2y &\mbox{if }0\le2y\le\pi\iff x\ge0 \\
-2y & \mbox{if } x<0\end{cases} $$
$$\implies\int_{-1/2}^1\cos^{-1}\dfrac{1-x^2}{1+x^2}dx=-2\int_{-1/2}^0\tan^{-1}x\ dx+2\int_0^1\tan^{-1}x\ dx$$
Now integrate by parts $$\displaystyle\int\tan^{-1}x\ dx=\tan^{-1}x\int\ dx-\int\left(\dfrac{d(\tan^{-1}x)}{dx}\int\ dx\right)dx$$
