<s>[INST] Integral $\int_{0}^{\frac{\pi}{4}}x\ln(\cos x)dx$ I would like to learn more about this integral:
$$\int_{0}^{\frac{\pi}{4}}x\ln(\cos x)dx=\frac{1}{128}\Big(16\pi \operatorname{C}-21\zeta(3)-4\pi^2\ln(2)\Big)$$
where $\operatorname{C}$ is the Catalan's constant.
I have tried integration by parts , substitution $y=\cos x$, etc. But, it reveals nothing. WA gives the anti-derivative in polylogarithmic functions that I don't know about.
I think it is a hard integral. If you have an elementary method to guide me, it would be nice.
Thanks a lot!
 [/INST] By the Fourier series of $\ln (\cos x)$
$$
\ln (\cos x)=-\ln 2+\sum_{k=1}^{\infty} \frac{(-1)^{k+1}}{k} \cos (2 k x),
$$
we have $$
x \ln (\cos x)=-x \ln 2+\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{k} x \cos (2 k x)
$$
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{4}} x \ln (\cos x) d x&=-\ln 2 \int_{0}^{\frac{\pi}{4}} x d x+\sum_{k=1}^{\infty} \frac{(-1)^{k+1}}{k} \int_{0}^{\frac{\pi}{4}} x \cos (2 k x) d x \\
&=-\frac{\pi^{2} \ln 2}{8}+\sum_{k=1}^{\infty} \frac{(-1)^{k+1}}{k} \int_{0}^{\frac{\pi}{4}} x \cos (2 k x) d x
\end{aligned}
$$
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{4}} x \cos (2 k x) d x &=\frac{1}{2 k} \int_{0}^{\frac{\pi}{4}} x d(\sin (2 k x)) \\
&=\left[\frac{x \sin (2 k x)}{2 k}\right]_{0}^{\frac{\pi}{4}}-\frac{1}{2 k} \int_{0}^{\frac{\pi}{4}} \sin (2 k x) d x \\ \\
&= \frac{\pi}{8 k} \sin \left(\frac{k \pi}{2}\right)+\frac{1}{4 k^{2}}\left(\cos \frac{k \pi}{2}-1\right)
\end{aligned}$$
$$
\begin{aligned}
\int_{0}^{\frac{\pi}{4}} x \ln (\cos x) d x&= -\frac{\pi^{2} \ln 2}{32}+\frac{\pi}{8} \sum_{k=1}^{\infty} \frac{(-1)^{k+1} \sin \left(\frac{k \pi}{2}\right)}{k^{2}}+  \frac{1}{4} \sum_{k=1}^{\infty} \frac{(-1)^{k+1}}{k^{3}}\left(\cos \frac{k \pi}{2}-1\right)\\&=-\frac{\pi^{2} \ln 2}{32}+\frac{\pi G}{8}+\frac{1}{4}S, 
\end{aligned}$$
where $G$ is the Catalan’s Constant.
$$\begin{aligned}S&=2 \sum_{k=1}^{\infty} \frac{(-1)^{k}}{k^{3}}\left(\sin ^{2} \frac{k \pi}{4}\right)\\&
=2\left[-\frac{1}{2} \sum_{k=0}^{\infty} \frac{1}{(2 k+1)^{3}}+\frac{1}{2^{3}} \sum_{k=1}^{\infty} \frac{1}{(2 k+1)^{3}}\right] \\
&=2\left[-\frac{3}{8} \sum_{k=0}^{\infty} \frac{1}{(2 k+1)^{3}}\right] \\
&=-\frac{3}{4}-\frac{7}{8}\zeta(3) \\
&=-\frac{21}{32} \zeta(3) \end{aligned}$$
Now we can conclude that$$
\boxed{\int_{0}^{\frac{\pi}{4}} x \ln (\cos x) d x= -\frac{\pi^{2} \ln 2}{32}+\frac{\pi G}{8}-\frac{21}{128} \zeta(3)} $$
</s>