# 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.

#### Solutions Collecting From Web of "Simple Integral $\int_0^\infty (1-x\cot^{-1} x)dx=\frac{\pi}{4}$."

Integrating by parts (as you’ve done),

\begin{align}\int x \cot^{-1}(x) \ dx &= x^{2} \cot^{-1} (x) – \int x\cot^{-1}(x) \ dx + \int \frac{x^{2}}{1+x^{2}} \ dx\\ \implies \int x \cot^{-1}(x) \ dx &= \frac{1}{2} \Big(x^{2} \cot^{-1} (x) + \int \ dx – \int \frac{1}{1+x^{2}} \ dx\Big)\\ &= \frac{1}{2} \Big(x^{2} \cot^{-1} (x) + x – \tan^{-1}(x)\Big).\end{align}

Therefore,

\begin{align}\int \left( 1- x \cot^{-1}(x) \right) \ dx &= x – \frac{1}{2} \Big(x^{2} \cot^{-1} (x) + x – \tan^{-1}(x)\Big)\\ &= \frac{1}{2} \left(x + \tan^{-1}(x) – x^{2}\cot^{-1}{x} \right).\end{align}

EDIT:

$$\lim_{x \to \infty} \left(x + \tan^{-1}(x) – x^{2}\cot^{-1}(x) \right) = \lim_{x \to \infty} \left[x + \tan^{-1}(x) – x^{2} \left(\frac{1}{x} + \mathcal{O}(x^{-3}) \right) \right] = \frac{\pi}{2}.$$

$\ds{I\equiv\int_{0}^{\infty}\bracks{1 – x\ {\rm arccot}\pars{x}}\,\dd x ={\pi \over 4}:\ {\large ?}}$

With $\ds{0 < \epsilon < \Lambda}$:
$$\int_{\epsilon}^{\Lambda}\bracks{1 – x\ {\rm arccot}\pars{x}}\,\dd x =\Lambda – \epsilon -\color{#c00000}{\int_{\epsilon}^{\Lambda}x\ {\rm arccot}\pars{x}\,\dd x}$$

\begin{align}
&\color{#c00000}{\int_{\epsilon}^{\Lambda}x\ {\rm arccot}\pars{x}\,\dd x}
=\int_{\epsilon}^{\Lambda}x\arctan\pars{1 \over x}\,\dd x
=-\int_{1/\epsilon}^{1/\Lambda}{\arctan\pars{x} \over x^{3}}\,\dd x
\\[3mm]&=\half\,\Lambda^{2}\arctan\pars{1 \over \Lambda}
-\half\,\epsilon^{2}\arctan\pars{1 \over \epsilon}
-\int_{1/\epsilon}^{1/\Lambda}{1 \over 2x^{2}}\,{1 \over x^{2} + 1}\,\dd x
\\[3mm]&=\half\,\Lambda^{2}\arctan\pars{1 \over \Lambda}
-\half\,\epsilon^{2}\arctan\pars{1 \over \epsilon}
-\half\int_{1/\epsilon}^{1/\Lambda}\pars{{1 \over x^{2}} – {1 \over x^{2} + 1}}
\,\dd x
\\[3mm]&=\half\,\Lambda^{2}\arctan\pars{1 \over \Lambda}
-\half\,\epsilon^{2}\arctan\pars{1 \over \epsilon}
+ \half\,\Lambda – \half\,\epsilon + \half\,\arctan\pars{1 \over \Lambda}
-\half\,\arctan\pars{1 \over \epsilon}
\end{align}

Then
\begin{align}
&\int_{\epsilon}^{\Lambda}\bracks{1 – x\ {\rm arccot}\pars{x}}\,\dd x
=\
\overbrace{\half\,\Lambda\bracks{1 – \Lambda\arctan\pars{\Lambda} – {1 \over \Lambda}\arctan\pars{1 \over \Lambda}}}
\\[3mm]&+\
\overbrace{\half\,\epsilon\bracks{\epsilon\arctan\pars{1 \over \epsilon} – 1}}
+\ \half\
\overbrace{\arctan\pars{1 \over \epsilon}}
^{\ds{\to\ {\pi \over 2}\ \mbox{when}\ \epsilon\ \to\ 0^{+}}}
\end{align}

$$\color{#00f}{\large% \int_{0}^{\infty}\bracks{1 – x\ {\rm arccot}\pars{x}}\,\dd x={\pi \over 4}}$$

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}

$\int(1-x\operatorname{arccot}(x))dx=x-\int x\operatorname{arccot}(x)dx$

$=x-(x^{2}\operatorname{arccot}(x))+\frac{x}{2}\ln(1+x^{2})-\int(x\operatorname{arccot}(x)+\frac{1}{2}\ln(1+x^{2})dx)$

$=x-x^{2}\operatorname{arccot}(x)-\frac{x}{2}\ln(1+x^{2})+\int x\operatorname{arccot}(x)dx+\frac{1}{2}\int\ln(1+x^{2})dx$

$=x-x^{2}\operatorname{arccot}(x)-\frac{x}{2}\ln(1+x^{2})+\int x\operatorname{arccot}(x)dx+\frac{1}{2}(x\ln(1+x^{2})-2\int\frac{x^{2}}{x^{2}+1}dx)$

$x-x^{2}\operatorname{arccot}(x)+\int x\operatorname{arccot}(x)dx-\int1dx+\int\frac{1}{x^{2}+1}dx$

$x-x^{2}\operatorname{arccot}(x)-\int(1-x\operatorname{arccot}(x)dx)+\arctan(x)$

Hence,

$$2\int(1-x\operatorname{arccot}(x))dx=x-x^{2}\operatorname{arccot}(x)+\arctan(x)$$

$$\int(1-x\operatorname{arccot}(x))dx=\frac{1}{2}(x-x^{2}\operatorname{arccot}(x)+\arctan(x))$$

Inverting $x\to1/x$ gives

$$\int_0^\infty(1-x\cot^{-1}x)dx=\int_0^\infty{x-\arctan x\over x^3}dx$$

Integration by parts with $u=x-\arctan x$ and $dv=dx/x^3$ turns this into

$${x-\arctan x\over2x^2}\Big|_0^\infty+{1\over2}\int_0^\infty{1\over1+x^2}dx$$

The final integral easily gives the desired $\pi/4$, so it remains to check that

$$\lim_{x\to0}{x-\arctan x\over2x^2}=\lim_{x\to\infty}{x-\arctan x\over2x^2}=0$$

But these limits are easy L’Hopital computations:

$${(x-\arctan x)’\over(2x^2)’}={1-\displaystyle{1\over1+x^2}\over4x}={x\over4(1+x^2)}$$