Evaluating $\int_{0}^{\frac{\pi}{2}} x^{2} \ln (\cos x) d x$ Latest Edit
As suggested by Mr Claude Leibovici, I go further to investigate the integral in general,
$$I_{m}:=\int_{0}^{\frac{\pi}{2}} x^{m} \ln (\cos x) d x$$
By the Fourier Series of ln(cos x)
,
$ \displaystyle \ln (\cos x)=-\ln 2+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \cos (2 n x) \tag*{(*)} $
Multiplying (*) by $ x^m$ and then Integrating both sides from $0 $ to $\frac{\pi}{2}$ yields
$$\begin{aligned}
I_m&=-\int_{0}^{\frac{\pi}{2}} x^{m} \ln 2 d x+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n !} \int_{0}^{\frac{\pi}{2}} x^{m} \cos (2 n x) d x\\&= -\frac{\pi^{m+1}\ln 2}{(m+1) 2^{m+1}}+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} J(m, n)\end{aligned}
$$
Next we need a reduction formula on $J(m,n)$.
Applying integration by parts twice, we obtain
$$
\begin{aligned}J(m, n)&=\frac{1}{2 n} \int_{0}^{\frac{\pi}{2}} x^{m} d(\sin 2 n x)\\ &= -\frac{m}{2 n} \int_{0}^{\frac{\pi}{2}} x^{m-1} \sin 2 n x d x\\&=\frac{m}{4 n^{2}} \int_{0}^{\frac{\pi}{2}} x^{m-1} d(\cos 2 n x)\\&=\frac{(-1)^{n} \pi^{m-1} m}{2^{m+1} n^{2}} -\frac{m(m-1)}{4 n^{2}} J (m-2, n)\end{aligned}
$$
By the reduction formula of $J(m,n)$, we can find $I_m$ by plugging $J(m,n)$.

By the Fourier Series of ln(cos x)
,
$ \displaystyle \ln (\cos x)=-\ln 2+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \cos (2 n x) \tag*{(*)} $
Multiplying (*) by $ x^2$ and then Integrating both sides from $0 $ to $\frac{\pi}{2}$ yields
$\displaystyle I=-\underbrace{\int_{0}^{\frac{\pi}{2}} x^{2} \ln 2 d x}_{\frac{\pi^{3} \ln 2}{24}}+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \underbrace{ \int_{0}^{\frac{\pi}{2}} x^{2} \cos (2 n x) d x}_{J_n}\tag*{} $
Integrating by parts twice yields
$\displaystyle \begin{aligned}J_{n} &=\frac{1}{2 n} \int_{0}^{\frac{\pi}{2}} x^{2} d(\sin 2 n x) \\&=\frac{1}{2 n}\left[x^{2} \sin 2 n x\right]_{0}^{\frac{\pi}{2}}-\frac{1}{n} \int_{0}^{\frac{\pi}{2}} x \sin 2 n x d x \\&=\frac{1}{2 n^{2}} \int_{0}^{\frac{\pi}{2}} x d(\cos 2 n x) \\&=\left[\frac{1}{2 n^{2}} x \cos 2 n x\right]_{0}^{\frac{\pi}{2}}-\frac{1}{2 n^{2}} \int_{0}^{\frac{\pi}{2}} \cos 2 n x d x \\&=\frac{\pi}{4 n^{2}} \cos n \pi-\frac{1}{2 n^{2}}\left[\frac{\sin 2 n x}{2 n}\right]_{0}^{\frac{\pi}{2}} \\&=\frac{\pi}{4 n^{2}} \cos n \pi\end{aligned}\tag*{} $
We can now conclude that
$\displaystyle \begin{aligned}I &=-\frac{\pi^{3} \ln 2}{24}+\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \cdot \frac{\pi}{4 n^{2}} \cos n \pi \\&=-\frac{\pi^{3} \ln 2}{24}+\frac{\pi}{4} \sum_{n=1}^{\infty} \frac{(-1)^{n+1}(-1)^{n}}{n^{3}} \\&=-\frac{\pi^{3} \ln 2}{24}-\frac{\pi}{4} \sum_{n=1}^{\infty} \frac{1}{n^{3}} \\&=\boxed{-\frac{\pi^{3} \ln 2}{24}-\frac{\pi}{4} \zeta(3)}\end{aligned}\tag*{} $
Is there any other method to evaluate $I$?

Hint for an alternative approach:
First, reduce the integral
$$
\int_0^{\pi/2} x^2\log(2\cos x)\,dx
= \frac{4\pi}7 \int_0^{\pi/2} x\log(2\cos x)\,dx
$$
and, then, show that
\begin{align}
&\int_0^{\pi/2} x\log(2\cos x)\,dx
= -\frac12\int_0^\infty \frac{\ln t\tan^{-1}t}{1+t^2} dt 
=- \frac 7{16}\zeta(3)
\end{align}
