Calculate:
$$\int_0^{\frac{\pi}{2}}{x^2\cot x\ln\cos x\, \text{d}x}$$
My attempt: Let $$ A=\int_0^{\frac{\pi}{2}}{x^2\cot x\ln\cos x\, \text{d}x},B=\int_0^{\frac{\pi}{2}}{x^2\cot x\ln\sin x\, \text{d}x} $$ then $$ A+B=\frac{\pi ^2\ln 2}{4}-\frac{7}{8}\zeta \left( 3 \right) +\underset{I}{\underbrace{\int_0^{\frac{\pi}{2}}{x^2\cot x\ln \left( \sin 2x \right)}\, \text{d}x}} $$ $$ A-B=\int_0^{\frac{\pi}{2}}{x^2\cot x\ln\cot x\, \text{d}x} $$ Define $$ J\left( a,b \right) =\int_0^{\frac{\pi}{2}}{\frac{\sin \left( 2ax \right)}{\sin ^b\left( 2x \right)}}\, \text{d}x $$ I‘ve been stuck here for a long time, I can't figure out $I$ by the derivative of $J(a,b)$.
Maybe I'm doing the wrong way. If so, how can I figure it out? THX!
$$\color{blue}{\int_0^{\pi /2} {{x^2}\cot x\ln (\cos x)\mathrm{d}x} = - \frac{{{\pi ^4}}}{{720}} + \frac{{\ln ^42}}{{24}} - \frac{{{\pi ^2}\ln ^22}}{6} + \text{Li}_4\left(\frac{1}{2}\right)}$$
It is easy to show that (using Fourier expansion of $\ln(\cos x)$ for instance): $$\int_0^{\pi/2} x^2 \cot x \ \mathrm{d}x = \frac{\pi^2 \ln 2}{4} - \frac{7\zeta(3)}{8}$$ Hence it suffices to consider $$I = \int_0^{\pi /2} {x^2}\cot x\ln (2\cos x)\mathrm{d}x $$ this alternative form will be proved convenient.
Now consider the twins: $$P = \int_0^1 {\frac{{{{\ln }^2}x\ln (1 + x)}}{{1 - x}}\mathrm{d}x} \qquad Q = \int_0^1 {\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 + x}}\mathrm{d}x} $$ We will see that $I$ arises from integrating $\ln^2 z \ln(1+z) / (1-z) $ around the semicircle contour above real axis. Indeed $$ P + \int_{ - 1}^0 {\frac{{{{\ln }^2}x\ln (1 + x)}}{{1 - x}}\mathrm{d}x} + \int_0^\pi {i{e^{ix}}\frac{{{{\ln }^2}({e^{ix}})\ln (1 + {e^{ix}})}}{{1 - {e^{ix}}}}\mathrm{d}x} = 0 $$ Hence $$\begin{aligned} P + \int_0^1 {\frac{{{{(\ln x + \pi i)}^2}\ln (1 - x)}}{{1 + x}}\mathrm{d}x} &= i\int_0^\pi {{x^2}\frac{{{e^{ix}}}}{{1 - {e^{ix}}}}\ln (1 + {e^{ix}})\mathrm{d}x} \\ &= - 4\int_0^{\pi/2} {{x^2}(\cot x + i)\left[ {\ln (2\cos x) + ix } \right]\mathrm{d}x} \end{aligned}$$ Discard imaginary part: $$P + Q - {\pi ^2}\int_0^1 {\frac{{\ln (1 - x)}}{{1 + x}}\mathrm{d}x} = - 4\int_0^{\pi /2} {\left[ {{x^2}\cot x\ln (2\cos x) - {x^3}} \right]\mathrm{d}x} = -4I + \frac{\pi^4}{16}$$
Thus it suffices to find $P$ and $Q$. If you're familiar with Euler sum or polylogarithm, these logarithm integrals of weight $4$ are standard. But nevertheless I will delineate how they're obtained. $$\begin{aligned} P &= \int_0^1 {\frac{{{{\ln }^2}x\ln (1 - {x^2})}}{{1 - x}}\mathrm{d}x} - \int_0^1 {\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 - x}}\mathrm{d}x} \\ &= \int_0^1 {\left( {\frac{x}{{1 - {x^2}}} + \frac{1}{{1 - {x^2}}}} \right){{\ln }^2}x\ln (1 - {x^2})\mathrm{d}x} - \int_0^1 {\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 - x}}\mathrm{d}x} \\ &= - \frac{7}{8}\int_0^1 {\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 - x}}\mathrm{d}x} + \int_0^1 {\frac{{{{\ln }^2}x\ln (1 - {x^2})}}{{1 - {x^2}}}\mathrm{d}x} \\ &= - \frac{7}{8}\int_0^1 {\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 - x}}\mathrm{d}x} + \frac{1}{8}\int_0^1 {{x^{ - 1/2}}\frac{{{{\ln }^2}x\ln (1 - x)}}{{1 - x}}\mathrm{d}x} \end{aligned}$$ Thus the value of $P$ can be calculated from the partial derivatives of $$\int_0^1 x^{a-1} (1-x)^{b-1} \mathrm{d}x = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$ and the result is $$P = -\frac{19\pi^4}{720} + \frac{7}{2}\ln 2 \zeta(3)$$
$Q$ does not succumb under such line of attack, indeed: $$Q = \frac{\pi^4}{90} + \frac{\pi^2 \ln^2 2}{6} - \frac{\ln^4 2}{6} - 4 \text{Li}_4 \left(\frac{1}{2}\right) $$
Denote $$A= \int_0^1 \frac{\ln x \ln^2(1-x)}{x} \mathrm{d}x \qquad B= \int_0^1 \frac{\ln x \ln^2(1+x)}{x} \mathrm{d}x \qquad C= \int_0^1 \frac{\ln x \ln(1+x) \ln(1-x)}{x} \mathrm{d}x $$ Due to the Euler sum $\sum H_n / n^3 = \pi^4 / 72$ (or via beta function as above), $A = -\pi^4 / 180$. Integration by parts on $C$ gives $$2C = P-Q$$ Also $$A + B + 2C = \int_0^1 {\frac{{\ln x{{\ln }^2}(1 - {x^2})}}{x}\mathrm{d}x} = \frac{1}{4}\int_0^1 {\frac{{\ln x{{\ln }^2}(1 - x)}}{x}\mathrm{d}x} = \frac{A}{4}$$ The reason for introducing these integrals is that $B$ is tamer than $Q$, its indefinite integral is a simple combination of polylogarithms up to order $4$, from which you can calculate: $$B = \frac{\pi^4}{24}+ \frac{\pi^2 \ln^2 2}{6} - \frac{\ln^4 2}{6} - 4\text{Li}_4(\frac{1}{2}) - \frac{7}{2}\ln 2 \zeta(3)$$
From these you can find the value of $Q$, hence finally $I$.