<s>[INST] Simple Integral $\int_0^\infty (1-x\cot^{-1} x)dx=\frac{\pi}{4}$. Hellow I am trying to prove this result.
$$
I:=\int_0^\infty (1-x\cot^{-1} x)dx=\frac{\pi}{4}.
$$
The indefinite integral exists for this integral.
The function $\cot^{-1} x$ is the arc-cotangent function, not the multiplicative inverse.  Note, we can not just break the integral up into two pieces because we will have problems with divergence.  
Using the relation 
$$
x\cot^{-1} x=x \tan^{-1} \frac{1}{x},\to \quad  I=\int_0^\infty \left(1-x\tan^{-1} \frac{1}{x}\right)dx
$$
may be of help to some but didn't help me.  I am not sure if I am missing a clever substitution, perhaps integration by parts will work, I obtained using this method
$$
I=(x-x^2\cot^{-1} x)\big|^\infty_0-\int_0^\infty \frac{x^2}{x^2+1}dx+\int_0^\infty x\cot^{-1} x \, dx
$$
but this is clearly a problem since we have divergence issue now.
The indefinite integral is given by
$$
\int (1-x\cot^{-1} x ) dx =\frac{1}{2}\left(x+\tan^{-1} x-x^2 \cot^{-1} x\right)
$$
but I am unable to prove this result.  Thanks.  
 [/INST] Let $y=\cot^{-1}x$, then $x=\cot y\;\Rightarrow\;dx=d(\cot y)$. The integral turns out to be
$$
\int(1-y\cot y)\ d(\cot y)=\int\ d(\cot y)-\int y\cot y\ d(\cot y).$$
The second integral in the RHS can be solved using IBP by taking $u=y$ and $dv=\cot y\ d(\cot y)$, we obtain $du=dy$ and $v=\dfrac12\cot^2 y$. Hence
$$
\int y\cot y\ d(\cot y)=\frac12y\cot^2 y-\frac12\int\cot^2 y\ dy,
$$
where
$$
\int\cot^2 y\ dy=\int(\csc^2 y-1)\ dy=-\cot y-y+C.
$$
Therefore
$$
\begin{align}
\int(1-y\cot y)\ d(\cot y)&=\cot y-\frac12y\cot^2 y-\frac12\cot y-\frac12y+C\\
&=\frac12(\cot y-y\cot^2 y-y)+C\\
\int (1-x\cot^{-1} x)\ dx&=\frac12\left(x-x^2\cot^{-1}x-\cot^{-1}x\right)+C.
\end{align}
$$
Actually, the result of integral is as the same result as yours Jeff. To make sure, using the identity $\tan^{-1}x+\cot^{-1}x=\dfrac\pi2$ for $x>0$ yields
$$
\begin{align}
\int (1-x\cot^{-1} x)\ dx&=\frac12\left(x-x^2\cot^{-1}x\right)-\frac12\cot^{-1}x+C\\
&=\frac12\left(x-x^2\cot^{-1}x\right)-\frac12\cot^{-1}x+\frac\pi4+K\\
&=\frac12\left(x-x^2\cot^{-1}x\right)+\frac12\left(\frac\pi2-\cot^{-1}x\right)+K\\
&=\frac12\left(x-x^2\cot^{-1}x\right)+\frac12\tan^{-1}x+K\\
&=\frac12\left(x+\tan^{-1}x-x^2\cot^{-1}x\right)+K.\qquad\blacksquare
\end{align}
$$
</s>