Help to Prove that $\int_{0}^{\pi\over 4}\arctan{(\cot^2{x})}\mathrm dx={2\pi^2-\ln^2({3+2\sqrt{2})}\over 16}$

We first write $I$ as

$$ I= \frac{\pi^2}{16} + \int_{0}^{\frac{\pi}{4}} \left( \arctan(\cot^2 x) - \arctan(1) \right) \, dx. $$

Now using addition formulas for $\arctan$ and $\cos$, we have

$$ \arctan(\cot^2 x) - \arctan(1) = \arctan\left(\frac{\cot^2 x - 1}{\cot^2 x + 1} \right) = \arctan(\cos 2x). $$

Consequently we have

\begin{align*} I &= \frac{\pi^2}{16} + \int_{0}^{\frac{\pi}{4}} \arctan(\cos 2x) \, dx \\ &= \frac{\pi^2}{16} + \frac{1}{2}\int_{0}^{\frac{\pi}{2}} \arctan(\sin \theta) \, d\theta, \end{align*}

where the last line follows from the substitution $\theta = \frac{\pi}{2} - 2x$. The last integral can be computed in terms of the Legendre chi function $\chi_2$:

$$ \int_{0}^{\frac{\pi}{2}} \arctan(\sin \theta) \, d\theta = 2\chi_2(\sqrt{2}-1). \tag{1} $$

For a proof of $\text{(1)}$, see my previous answer for instance. There are only a handful of known special values of $\chi_2$, but thankfully

$$\chi_2(\sqrt{2}-1) = \frac{\pi^2}{16} - \frac{1}{4}\log^2(\sqrt{2}+1) \tag{2} $$

is one of them. Summarizing, we have

$$ I = \frac{\pi^2}{8} - \frac{1}{4}\log^2(\sqrt{2}+1), $$

which coincides with the proposed answer.


Addendum. The identity $\text{(2)}$ follows by plugging $x = \sqrt{2}-1$ to the identity

$$ \chi_2\left(\frac{1-x}{1+x}\right) + \chi_2(x) = \frac{\pi^2}{8} - \frac{1}{2}\log x \log\left(\frac{1-x}{1+x}\right), $$

which can be easily checked by differentiating both sides.


For the evaluation of $\displaystyle J=\int_0^{\tfrac{\pi}{2}}\arctan(\sin x)dx$

Perform the change of variable $y=\sin x$,

$\displaystyle J=\int_0^1 \dfrac{\arctan x}{\sqrt{1-x^2}}dx$

Perform the change of variable $y=\sqrt{\dfrac{1-x}{1+x}}$,

$\begin{align}\displaystyle J&=2\int_0^1 \dfrac{\arctan\left(\tfrac{1-x^2}{1+x^2}\right)}{1+x^2}dx\\ &=2\int_0^1 \dfrac{\arctan(1)}{1+x^2}dx-2\int_0^1 \dfrac{\arctan(x^2)}{1+x^2}dx\\ &=\dfrac{\pi^2}{8}-2\int_0^1 \dfrac{\arctan(x^2)}{1+x^2}dx\\ \end{align}$

$\begin{align} \displaystyle\int_0^1 \dfrac{\arctan(x^2)}{1+x^2}dx&=\Big[\arctan x\arctan(x^2)\Big]_0^1-\int_0^1 \dfrac{2x\arctan x}{1+x^4}dx\\ &=\dfrac{\pi^2}{16}-\int_0^1 \dfrac{2x\arctan x}{1+x^4}dx\\ \end{align}$

Since,

$\displaystyle \arctan x=\int_0^1 \dfrac{x}{1+t^2x^2}dx$

then,

$\begin{align} \displaystyle K&=\int_0^1 \dfrac{2x\arctan x}{1+x^4}dx\\ \displaystyle &=\int_0^1\int_0^1 \dfrac{2x^2}{(1+t^2x^2)(1+x^4)}dtdx\\ \displaystyle &=\int_0^1\int_0^1 \left(\dfrac{2t^2}{(1+t^4)(1+x^4)}+\dfrac{2x^2}{(1+x^4)(1+t^4)}-\dfrac{2t^2}{(1+t^4)(1+t^2x^2}\right)dtdx\\ &=\displaystyle 4\left(\int_0^1 \dfrac{t^2}{1+t^4}dt\right)\left(\int_0^1 \dfrac{1}{1+x^4}dx\right)-K \end{align}$

Therefore,

$\displaystyle K=2\left(\int_0^1 \dfrac{x^2}{1+x^4}dx\right)\left(\int_0^1 \dfrac{1}{1+x^4}dx\right)$

Since,

$\begin{align}\displaystyle \int_0^1 \dfrac{x^2}{1+x^4}dx&=\left[\dfrac{1}{4\sqrt{2}}\ln\left(\dfrac{x^2-\sqrt{2}x+1}{x^2+\sqrt{2}x+1}\right)+\dfrac{1}{2\sqrt{2}}\arctan\left(\sqrt{2}x+1\right)+\dfrac{1}{2\sqrt{2}}\arctan\left(\sqrt{2}x-1\right)\right]_0^1\\ &=\dfrac{1}{4\sqrt{2}}\Big(\pi+\ln\left(3-2\sqrt{2}\right)\Big) \end{align}$

and,

$\begin{align}\displaystyle \int_0^1 \dfrac{1}{1+x^4}dx&=\left[\dfrac{1}{4\sqrt{2}}\ln\left(\dfrac{x^2+\sqrt{2}x+1}{x^2-\sqrt{2}x+1}\right)+\dfrac{1}{2\sqrt{2}}\arctan\left(\sqrt{2}x+1\right)+\dfrac{1}{2\sqrt{2}}\arctan\left(\sqrt{2}x-1\right)\right]_0^1\\ &=\dfrac{1}{4\sqrt{2}}\Big(\pi-\ln\left(3-2\sqrt{2}\right)\Big) \end{align}$

Therefore,

$\boxed{K=\displaystyle \dfrac{\pi^2}{16}-\dfrac{1}{16}\Big(\ln\left(3-2\sqrt{2}\right)\Big)^2}$

Therefore,

$\boxed{\displaystyle\int_0^1 \dfrac{\arctan(x^2)}{1+x^2}dx=\dfrac{1}{16}\Big(\ln\left(3-2\sqrt{2}\right)\Big)^2}$

Therefore,

$\boxed{\displaystyle J=\dfrac{\pi^2}{8}-\dfrac{1}{8}\Big(\ln\left(3-2\sqrt{2}\right)\Big)^2}$

Addendum:

$\displaystyle I=\int_0^{\tfrac{\pi}{4}} \arctan\left(\cot^2(x)\right)dx$

Perform the change of variable,

$y=\tan x$,

$\begin{align}I&=\displaystyle \int_0^1 \dfrac{\arctan\left(\tfrac{1}{x^2}\right)}{1+x^2}dx\\ &=\displaystyle \int_0^1 \dfrac{\tfrac{\pi}{2}-\arctan\left(x^2\right)}{1+x^2}dx\\ &=\displaystyle \dfrac{\pi^2}{8}-\int_0^1 \dfrac{\arctan\left(x^2\right)}{1+x^2}dx \end{align}$