Integral $\int_0^\frac{\pi}{2} x^2\sqrt{\tan x}\,\mathrm dx$

On the path of Zacky, the missing part...

Let,

\begin{align}I&=\int_0^{\frac{\pi}{2}}x^2\sqrt{\tan x}\,dx\\ J&=\int_0^{\frac{\pi}{2}}\frac{x^2}{\sqrt{\tan x}}\,dx\\ \end{align}

Perform the change of variable $y=\sqrt{\tan x}$,

\begin{align}I&=\int_0^{\infty}\frac{2x^2\arctan^2\left(x^2\right)}{1+x^4}\,dx\\\\ J&=\int_0^{\infty}\frac{2x^2\arctan^2\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}

\begin{align} \text{I+J}&=\int_0^{\infty}\frac{2x^2\left(\arctan\left(x^2\right)+\arctan\left(\frac{1}{x^2}\right)\right)^2}{1+x^4}\,dx-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ &=\frac{\pi^2}{4}\int_0^{\infty}\frac{2x^2}{1+x^4}\,dx-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}

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

\begin{align} \text{K}&=\int_0^{\infty}\frac{2x^2}{1+x^4}\,dx\\ &=\int_0^{\infty}\frac{2}{1+x^4}\,dx\\ \end{align}

Therefore,

\begin{align} \text{2K}=\int_0^{\infty}\frac{2\left(1+\frac{1}{x^2}\right)}{\left(x-\frac{1}{x}\right)^2+2}\,dx \end{align}

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

\begin{align}\text{2K}&=2\int_{-\infty}^{+\infty}\frac{1}{2+x^2}\,dx\\ &=2\left[\frac{1}{\sqrt{2}}\arctan\left(\frac{x}{\sqrt{2}}\right)\right]_{-\infty}^{+\infty}\\ &=2\times \frac{\pi}{\sqrt{2}} \end{align}

therefore,

\begin{align} \text{I+J}&=\frac{\pi^3}{4\sqrt{2}}-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}

Let $a>0$,

\begin{align} \text{K}_1(a)&=\int_0^{\infty}\frac{x^2}{a+x^4}\,dx\\ &=\frac{1}{a}\int_0^{\infty}\frac{x^2}{1+\left(a^{-\frac{1}{4}}x\right)^4}\,dx\\ \end{align}

Perform the change of variable $y=a^{-\frac{1}{4}}x$,

\begin{align} \text{K}_1(a)&=a^{-\frac{1}{4}}\int_0^{\infty}\frac{x^2}{1+x^4}\,dx\\ &=\frac{a^{-\frac{1}{4}}\pi}{2\sqrt{2}} \end{align}

In the same manner,

\begin{align} \text{K}_2(a)&=\int_0^{\infty}\frac{x^2}{1+ax^4}\,dx\\ &=\frac{a^{-\frac{3}{4}}\pi}{2\sqrt{2}} \end{align}

Since, for $a$ real,

\begin{align}\arctan a=\int_0^1 \frac{a}{1+a^2t^2}\,dt\end{align}

then,

\begin{align}\text{L}&=\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ &=\int_0^{\infty}\left(\int_0^1 \int_0^1 \frac{x^2}{(1+u^2x^4)\left(1+\frac{v^2}{x^4}\right)(1+x^4)}\,du\,dv\right)\,dx\\ &=\\ &\int_0^{\infty}\left(\int_0^1\int_0^1 \left(\frac{x^2}{(1-u^2)(1-v^2)(1+x^4)}-\frac{x^2}{1-u^2v^2}\left(\frac{u^2}{(1-u^2)(1+u^2x^4)}+\frac{v^2}{(1-v^2)(v^2+x^4)}\right) \right)dudv\right)dx\\ &=\int_0^1\int_0^1 \left(\frac{\pi}{2\sqrt{2}(1-u^2)(1-v^2)}-\frac{1}{1-u^2v^2}\left(\frac{u^2\text{K}_2(u^2)}{1-u^2}+\frac{v^2\text{K}_1(v^2)}{1-v^2}\right)\right)dudv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\int_0^1 \left(\frac{1}{(1-u^2)(1-v^2)}-\frac{1}{(1-u^2v^2)}\left(\frac{u^{\frac{1}{2}}}{1-u^2}+\frac{v^{\frac{3}{2}}}{1-v^2}\right)\right)dudv\\ &=\pi\int_0^1\left[\frac{\sqrt{v}\left(\text{ arctanh}\left(\sqrt{uv}\right)-\text{ arctan}\left(\sqrt{uv}\right)-\text{ arctanh}\left(uv\right)\right)+\arctan\left(\sqrt{u}\right)+\ln\left(\frac{\sqrt{1+u}}{1+\sqrt{u}}\right)}{2\sqrt{2}(1-v^2)}\right]_{u=0}^{u=1}\,dv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\big(\text{ arctanh}\left(\sqrt{v}\right)-\text{ arctan}\left(\sqrt{v}\right)-\text{ arctanh}\left(v\right)\big)+\frac{\pi}{4}-\frac{1}{2}\ln 2}{1-v^2}\,dv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\arctan\left(\frac{1-\sqrt{v}}{1+\sqrt{v}}\right)}{1-v^2}\,dv+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right)\int_0^1 \frac{1-\sqrt{v}}{1-v^2}\,dv+\\ &\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+\sqrt{v}}{2}\right)}{1-v^2}\,dv-\frac{\pi}{4\sqrt{2}}\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+v}{2}\right)}{1-v^2}\,dv \end{align}

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

\begin{align}\text{R}_1&=\int_0^1\frac{\sqrt{v}\arctan\left(\frac{1-\sqrt{v}}{1+\sqrt{v}}\right)}{1-v^2}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\arctan v}{v(1+v^2)}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{\arctan v}{v}\,dv-\int_0^1 \frac{\arctan v}{1+v^2}\,dv\\ &=\frac{1}{2}\text{G}-\frac{1}{2}\Big[\arctan^2 v\Big]_0^1\\ &=\frac{1}{2}\text{G}-\frac{\pi^2}{32}\\ \text{R}_2&=\int_0^1 \frac{1-\sqrt{v}}{1-v^2}\,dv\\ &=\left[\ln\left(\frac{\sqrt{1+v}}{1+\sqrt{v}}\right)+\arctan\left(\sqrt{v}\right)\right]_0^1\\ &=\frac{\pi}{4}-\frac{1}{2}\ln 2\\ \end{align}

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

\begin{align}\text{R}_3&=\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+\sqrt{v}}{2}\right)}{1-v^2}\,dv\\ &=-\frac{1}{2}\int_0^1\frac{(1-v)^2\ln(1+v)}{v(1+v^2)}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{1}{2}\int_0^1 \frac{\ln(1+v )}{v}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{1}{4}\int_0^1 \frac{2v\ln(1-v^2)}{v^2}\,dv+\frac{1}{2}\int_0^1 \frac{\ln(1-v)}{v}\,dv\\ \end{align}

In the second integral perform the change of variable $y=v^2$,

\begin{align}\text{R}_3&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\int_0^1 \frac{\ln(1-v)}{v}\,dv\\ \end{align}

In the second integral perform the change of variable $y=1-v$,

\begin{align}\text{R}_3&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\int_0^1 \frac{\ln v}{1-v}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\times -\zeta(2)\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{\pi^2}{24}\\ \end{align}

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

\begin{align} \text{S}_1&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv\\ &=\int_0^1\frac{\ln(\frac{2}{1+v})}{1+v^2}\,dv\\ &=\ln 2\int_0^1 \frac{1}{1+v^2}\,dv-\text{S}_1\\ &=\frac{\pi}{4}\ln 2-\text{S}_1 \end{align}

Therefore,

\begin{align} \text{S}_1&=\frac{\pi}{8}\ln 2\\ \text{R}_3&=\frac{\pi}{8}\ln 2-\frac{\pi^2}{24}\\ \end{align}

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

\begin{align} \text{R}_4&=\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+v}{2}\right)}{1-v^2}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\ln\left(\frac{1+v^2}{(1+v)^2}\right)}{v(1+v^2)}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\ln\left(1+v^2\right)}{v(1+v^2)}\,dv+2\text{R}_3\\ &=\frac{1}{2}\int_0^1\frac{\ln(1+v^2)}{v}\,dv-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv+\frac{\pi}{4}\ln 2-\frac{\pi^2}{12}\\ &=\frac{1}{2}\times \frac{1}{4}\zeta(2)-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv+\frac{\pi}{4}\ln 2-\frac{\pi^2}{12}\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1\int_0^1\frac{v^2}{(1+v^2)(1+v^2t)}\,dt\,dv\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1 \left[\frac{\arctan\left(v\right)\sqrt{t}-\arctan\left(v\sqrt{t}\right)}{(t-1)\sqrt{t}}\right]_{v=0}^{v=1}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1 \frac{\frac{\pi\sqrt{t}}{4}-\arctan\left(\sqrt{t}\right)}{(t-1)\sqrt{t}}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}+\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\int_0^1 \frac{\sqrt{t}-1}{(t-1)\sqrt{t}}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}+\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\Big[2\ln\left(1+\sqrt{t}\right)\Big]_0^1\\ &=\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ \end{align}

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

\begin{align} \text{R}_4&=\int_0^1 \frac{\arctan t}{t}\,dt-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ &=\text{G}-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ \end{align}

Therefore,

\begin{align}L&=\frac{\pi}{2\sqrt{2}}\text{R}_1+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right) \text{R}_2+\frac{\pi}{2\sqrt{2}}\text{R}_3-\frac{\pi}{4\sqrt{2}}\text{R}_4\\ &=\frac{\pi}{2\sqrt{2}}\left(\frac{\text{G}}{2}-\frac{\pi^2}{32}\right)+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right)^2+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{8}\ln 2-\frac{\pi^2}{24}\right)-\\ &\frac{\pi}{4\sqrt{2}}\left(\text{G}-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\right)\\ &=\frac{\pi^3}{96\sqrt{2}}+\frac{\pi\ln^2 2}{8\sqrt{2}} \end{align}

Thus, \begin{align}\text{I+J}&=\frac{\pi^3}{4\sqrt{2}}-4\text{L}\\ &=\frac{\pi^3}{4\sqrt{2}}-4\left(\frac{\pi^3}{96\sqrt{2}}+\frac{\pi\ln^2 2}{8\sqrt{2}}\right)\\ &=\boxed{\frac{5\pi^3}{24\sqrt{2}}-\frac{\pi\ln^2 2}{2\sqrt{2}}} \end{align}


Both integrals depend on $$\int_{0}^{\pi} x^2 \frac{\sqrt{1+\cos x}\pm \sqrt{1-\cos x}}{\sqrt{\sin x}}\,dx=\\\int_{0}^{\pi/2}\frac{dx}{\sqrt{\sin x}}\left[(x^2\pm(\pi-x)^2)\sqrt{1+\cos x}+(\pm x^2+(\pi-x)^2)\sqrt{1-\cos x}\right]\,dx $$ and they can be tackled through the Fourier series of a periodic version of $x^2\pm(\pi-x)^2$. For instance

$$ x^2+(\pi-x)^2 = \frac{2\pi^2}{3}+2\sum_{n\geq 1}\frac{\cos(2nx)}{n^2}\qquad \forall x\in[0,\pi] $$ (yes, I am exploiting Bernoulli polynomials) and for any $n\in\mathbb{N}^+$ $$ \int_{0}^{\pi/2}\frac{\sqrt{1+\cos x}+\sqrt{1-\cos x}}{\sqrt{\sin x}}\cos(2nx)\,dx=\frac{\pi}{4^n\sqrt{2}}\binom{2n}{n}$$ so the whole question boils down to computing $$ \sum_{n\geq 1}\frac{1}{n^2 4^n}\binom{2n}{n} = \frac{1}{2}\,\phantom{}_4 F_3\left(1,1,1,\tfrac{3}{2};2,2,2;1\right)=\zeta(2)-2\log^2(2).$$ The last equality follows by recalling $\frac{1}{4^n}\binom{2n}{n}=\frac{2}{\pi}\int_{0}^{\pi/2}(\sin t)^{2n}\,dt$ and by tackling $$ \int_{0}^{1}\frac{\text{Li}_2(z)}{\sqrt{z(1-z)}}\,dz $$ through Fourier-Legendre series or the reflection formula for $\text{Li}_2$.
The remaining part is just related to the well-known $$ \int_{0}^{1}\frac{\log x}{\sqrt{x(1-x)}}\,dx = 4\int_{0}^{\pi/2}\log\sin\theta\,d\theta = -2\pi\log 2.$$ Summarizing, all the involved integrals just depend on $\left.\frac{d^\nu}{da^\nu}B\left(a,\tfrac{1}{2}\right)\right|_{a=1/2}$ for $\nu\in\{1,2\}$.