How do you find the integral of $$ \int_0^{\pi/2}\left(\pi x - 4x^{2}\right) \log\left(1 + \tan\left(x\right)\right)\,\mathrm{d}x $$
The integral can be simplified to $$ \int_0^{\pi/2}x\left(4x + {\pi}\right) \ln\left(1 - \dfrac{\mathrm{i}\left[\mathrm{e}^{\mathrm{i}x}-\mathrm{e}^{-\mathrm{i}x}\right]}{\mathrm{e}^{\mathrm{i}x}+\mathrm{e}^{-\mathrm{i}x}}\right) \,\mathrm{d}x$$
Now complete
Even though the polynomial term within the original integrand has an interesting symmetry concerning the substitution $x-\frac\pi4\mapsto x$ we will just split the integral into two parts. Lets start with the first one, the one only containing a linear polynomial, by rewriting the trigonometric part in the following way
$$\small\begin{align*} \pi\int_0^\frac\pi2 x\log(1+\tan x)\mathrm dx&=\pi\int_0^\frac\pi2 x\log(\sin x+\cos x)\mathrm dx-\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx\\ &=\pi\int_0^\frac\pi2 x\log\left(\sqrt2\sin\left(x+\frac\pi4\right)\right)\mathrm dx-\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx\\ &=\frac{\pi^3}{16}\log2+\pi\int_0^\frac\pi2 x\log\left(\sin\left(x+\frac\pi4\right)\right)\mathrm dx-\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx\\ &=\frac{\pi^3}{16}\log2+\underbrace{\pi\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)\log(\sin x)\mathrm dx}_{=I_1}\underbrace{-\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx}_{=I_2} \end{align*}$$
The reason why we actually want to use the Clausen Function here is the simple fact that this function is capable of providing a closed-form anti-derivative for $\log(\sin x)$ and $\log(\cos x)$ respectively. Thus, for $I_1$ we obtain
$$\small\begin{align*} \pi\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)\log(\sin x)\mathrm dx&=\pi\int_\frac\pi4^{\frac{3\pi}4}x\log(\sin x)\mathrm dx-\frac{\pi^2}4\int_\frac\pi4^{\frac{3\pi}4}\log(\sin x)\mathrm dx\\ &=\pi\left\{\left[x\left(-\frac12\operatorname{Cl}_2(2x)-x\log2\right)\right]_\frac\pi4^{\frac{3\pi}4}+\int_\frac\pi4^{\frac{3\pi}4}\frac12\operatorname{Cl}_2(2x)+x\log2~\mathrm dx\right\}\\ &~~~~+\frac{\pi^2}4\left[\frac12\operatorname{Cl}_2(2x)+x\log2\right]_\frac\pi4^{\frac{3\pi}4}\\ &=\frac{\pi^2}4\mathrm G-\frac{3\pi^3}8\log2+\pi\int_\frac\pi4^{\frac{3\pi}4}\frac12\operatorname{Cl}_2(2x)+x\log2~\mathrm dx\\ &=\frac{\pi^2}4\mathrm G-\frac{\pi^3}8\log2+\frac\pi4\int_\frac\pi2^{\frac{3\pi}2}\operatorname{Cl}_2(x)\mathrm dx\\ &=\frac{\pi^2}4\mathrm G-\frac{\pi^3}8\log2+\underbrace{\frac\pi4\left[-\operatorname{Cl}_3(x)\right]_\frac\pi2^{\frac{3\pi}2}}_{=0}\\ \therefore~\pi\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)\log(\sin x)\mathrm dx&=\frac{\pi^2}4\mathrm G-\frac{\pi^3}8\log2 \end{align*}$$
Similar for $I_2$ we eventually get
$$\small\begin{align*} -\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx&=-\pi\left[x\left(\frac12\operatorname{Cl}_2(\pi-2x)-x\log2\right)\right]_0^\frac\pi2+\pi\int_0^\frac\pi2\frac12\operatorname{Cl}_2(\pi-2x)-x\log2~\mathrm dx\\ &=\frac{\pi^3}8\log2+\frac\pi4\int_0^\pi\operatorname{Cl}_2(x)\mathrm dx\\ &=\frac{\pi^3}8\log2+\frac\pi4[\zeta(3)-\operatorname{Cl}_3(\pi)]\\ &=\frac{\pi^3}8\log2+\frac\pi4[\zeta(3)+\eta(3)]\\ \therefore~-\pi\int_0^\frac\pi2 x\log(\cos x)\mathrm dx&=\frac{\pi^3}8\log2+\frac{7\pi}{16}\zeta(3) \end{align*}$$
Combining those two results we get
We can deal with the quadratic parts in a similar manner whilst the calculation will become quite nasty. However, lets start
$$\small\begin{align*} -4\int_0^\frac\pi2x^2\log(1+\tan x)\mathrm dx&=-4\int_0^\frac\pi2 x^2\log(\sin x+\cos x)\mathrm dx+4\int_0^\frac\pi2 x^2\log(\cos x)\mathrm dx\\ &=-4\int_0^\frac\pi2 x^2\log\left(\sqrt2\sin\left(x+\frac\pi4\right)\right)\mathrm dx+4\int_0^\frac\pi2 x^2\log(\cos x)\mathrm dx\\ &=-\frac{\pi^3}{12}\log2-4\int_0^\frac\pi2 x^2\log\left(\sin\left(x+\frac\pi4\right)\right)\mathrm dx+4\int_0^\frac\pi2 x^2\log(\cos x)\mathrm dx\\ &=-\frac{\pi^3}{12}\log2\underbrace{-4\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)^2\log(\sin x)\mathrm dx}_{=I_3}\underbrace{+4\int_0^\frac\pi2 x^2\log(\cos x)\mathrm dx}_{=I_4} \end{align*}$$
What is new within $I_3$ and $I_4$ in contrast to $I_1$ and $I_2$ are the $x^2$ terms. the remaining parts can be handled as above. Thus, by expanding the squared term we obtain
$$\small\begin{align*} -4\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)^2\log(\sin x)\mathrm dx&=-4\int_\frac\pi4^{\frac{3\pi}4}\left(x^2-\frac\pi2x+\frac{\pi^2}{16}\right)\log(\sin x)\mathrm dx\\ &=2\pi\left\{\left[x\left(-\frac12\operatorname{Cl}_2(2x)-x\log2\right)\right]_\frac\pi4^{\frac{3\pi}4}+\int_\frac\pi4^{\frac{3\pi}4}\frac12\operatorname{Cl}_2(2x)+x\log2~\mathrm dx\right\}\\ &~~~~+\frac{\pi^2}4\left[\frac12\operatorname{Cl}_2(2x)+x\log2\right]_\frac\pi4^{\frac{3\pi}4}-4\int_\frac\pi4^{\frac{3\pi}4}x^2\log(\sin x)\mathrm dx\\ &=\frac{3\pi^2}4\mathrm G-\frac{7\pi^3}8\log2+2\pi\int_\frac\pi4^{\frac{3\pi}4}\frac12\operatorname{Cl}_2(2x)+x\log2~\mathrm dx-4\int_\frac\pi4^{\frac{3\pi}4}x^2\log(\sin x)\mathrm dx\\ &=\frac{3\pi^2}4\mathrm G-\frac{3\pi^3}8\log2+\frac\pi2\int_\frac\pi4^{\frac{3\pi}4}\operatorname{Cl}_2(x)\mathrm dx-4\int_\frac\pi2^{\frac{3\pi}2}x^2\log(\sin x)\mathrm dx\\ &=\frac{3\pi^2}4\mathrm G-\frac{3\pi^3}8\log2+\underbrace{\frac\pi4\left[-\operatorname{Cl}_3(x)\right]_\frac\pi2^{\frac{3\pi}2}}_{=0}-4\int_\frac\pi2^{\frac{3\pi}2}x^2\log(\sin x)\mathrm dx\\ \therefore~-4\int_\frac\pi4^{\frac{3\pi}4}\left(x-\frac\pi4\right)^2\log(\sin x)\mathrm dx&=\frac{3\pi^2}4\mathrm G-\frac{3\pi^3}8\log2\underbrace{-4\int_\frac\pi2^{\frac{3\pi}2}x^2\log(\sin x)\mathrm dx}_{=I_5} \end{align*}$$
Up to here it does not look that bad. However, as I already mentioned the really nasty part is right in front of us. It remains to somehow evaluate the remaining integrals $I_4$ and $I_5$ respectively. Applying Integration By Parts to $I_4$ two times we obtain
$$\small\begin{align*} 4\int_0^\frac\pi2x^2\log(\cos x)\mathrm dx&=4\left[x^2\left(\frac12\operatorname{Cl}_2(\pi-2x)-x\log2\right)\right]_0^\frac\pi2-8\int_0^\frac\pi2x\left(\frac12\operatorname{Cl}_2(\pi-2x)-x\log2\right)\mathrm dx\\ &=-\frac{\pi^3}2\log2-4\int_0^\frac\pi2x\operatorname{Cl}_2(\pi-2x)\mathrm dx+8\int_0^\frac\pi2x^2\log2~\mathrm dx\\ &=-\frac{\pi^3}6\log2-4\int_0^\frac\pi2x\operatorname{Cl}_2(\pi-2x)\mathrm dx\\ &=-\frac{\pi^3}6\log2-2\int_0^\pi(\pi-x)\operatorname{Cl}_2(x)\mathrm dx\\ &=-\frac{\pi^3}6\log2-\pi\int_0^\pi\operatorname{Cl}_2(x)\mathrm dx+\int_0^\pi x\operatorname{Cl}_2(x)\mathrm dx\\ &=-\frac{\pi^3}6\log2-\pi[\zeta(3)-\operatorname{Cl}_3(\pi)]-[x\operatorname{Cl}_3(x)]_0^\pi+\int_0^\pi\operatorname{Cl}_3(x)\mathrm dx\\ &=-\frac{\pi^3}6\log2-\pi\zeta(3)+\underbrace{[\operatorname{Cl}_4(\pi)]_0^\pi}_{=0}\\ \therefore~4\int_0^\frac\pi2x^2\log(\cos x)\mathrm dx&=-\frac{\pi^3}6\log2-\pi\zeta(3) \end{align*}$$
Preceding in the same manner with $I_5$ we get
$$\small\begin{align*} -4\int_\frac\pi4^{\frac{3\pi}4}x^2\log(\sin x)\mathrm dx&=-4\left[x^2\left(-\frac12\operatorname{Cl}_2(2x)-x\log2\right)\right]_\frac\pi4^{\frac{3\pi}4}-8\int_\frac\pi4^{\frac{3\pi}4}x\left(\frac12\operatorname{Cl}_2(2x)+x\log2\right)\mathrm dx\\ &=\frac{13\pi^3}8\log2-\frac{5\pi^2}4\mathrm G-8\int_\frac\pi4^{\frac{3\pi}4}x\left(\frac12\operatorname{Cl}_2(2x)+x\log2\right)\mathrm dx\\ &=\frac{13\pi^3}{24}\log2-\frac{5\pi^2}4\mathrm G-4\int_\frac\pi4^{\frac{3\pi}4}x\operatorname{Cl}_2(2x)\mathrm dx\\ &=\frac{13\pi^3}{24}\log2-\frac{5\pi^2}4\mathrm G-\int_\frac\pi2^{\frac{3\pi}2}x\operatorname{Cl}_2(x)\mathrm dx\\ &=\frac{13\pi^3}{24}\log2-\frac{5\pi^2}4\mathrm G+[x\operatorname{Cl}_3(x)]_\frac\pi2^{\frac{3\pi}2}-\int_\frac\pi2^{\frac{3\pi}2}\operatorname{Cl}_3(x)\mathrm dx\\ &=\frac{13\pi^3}{24}\log2-\frac{5\pi^2}4\mathrm G-\frac{3\pi}{32}\zeta(3)-[\operatorname{Cl}_4(x)]_\frac\pi2^{\frac{3\pi}2}\\ \therefore~-4\int_\frac\pi4^{\frac{3\pi}4}x^2\log(\sin x)\mathrm dx&=\frac{13\pi^3}{24}\log2-\frac{5\pi^2}4\mathrm G-\frac{3\pi}{32}\zeta(3)+2\beta(4) \end{align*}$$
Putting the afore-deduced together yields
Now, combining $(1)$ and $(2)$ we finally arrive at
Numerically this works out. Even though WolframAlpha does not provide a closed-form for the original integral it is capable of expressing what I referred to as $I_4$, the really hard part here. WolframAlpha returns an expression for $I_4$ containing a combination of Trilogarithms which are precisely the here occuring Dirichlet Beta Function term while it does not return a closed-form expression for $I_5$ which is somewhat strange since this derivation was way easier.
It is quite interesting how this all boils down to $\beta(4)$, which is the only remaining term not expressible in terms of other constants (one may argue that $\zeta(3)$ is also only a series in disguise but it more used then $\beta(4)$ I would claim). Moreover the final expression $(\star)$ looks more friendly than the raw Maple output provided by Dr. Sonnhard Graubner.