[Math] Evaluating $\int _0^{\frac{\pi }{2}}x\cot \left(x\right)\ln ^2\left(\cos \left(x\right)\right)\:dx$

calculusdefinite integralsintegration

I want to evaluate $\displaystyle \int _0^{\frac{\pi }{2}}x\cot \left(x\right)\ln ^2\left(\cos \left(x\right)\right)\:dx$ but it's quite difficult.
I have tried to rewrite the integral as
$$\int _0^{\frac{\pi }{2}}x\cot \left(x\right)\ln ^2\left(\cos \left(x\right)\right)\:dx=\frac{\pi }{2}\int _0^{\frac{\pi }{2}}\tan \left(x\right)\ln ^2\left(\sin \left(x\right)\right)\:dx-\int _0^{\frac{\pi }{2}}x\tan \left(x\right)\ln ^2\left(\sin \left(x\right)\right)\:dx$$
I've also tried to integrate by parts in multiple ways yet I cant go forth with this integral, I also tried using the substitution $t=\tan{\frac{x}{2}}$ but cant get anything to work, I'll appreciate any sort of help.

I also tried using the classical expansion
$$\ln \left(\cos \left(x\right)\right)=-\ln \left(2\right)-\sum _{n=1}^{\infty }\frac{\left(-1\right)^n\cos \left(2nx\right)}{n},\:-\frac{\pi }{2}<x<\frac{\pi }{2}$$
But it only gets worse.

Best Answer

$$I=\frac{1}{2}\int_0^{\pi/2} x^2\frac{\ln^2\cos x}{\sin^2x} \, dx+\int_0^{\pi/2} x^2{\ln\cos x}\,dx$$ integrating by parts $$\int_0^{\pi/2} x^2 \ln\cos x \, dx=\frac{\pi^3}{24}\ln2-\frac{\pi}{4}\zeta(3)$$ see Integral $\int_0^\pi \theta^2 \ln^2\big(2\cos\frac{\theta}{2}\big)d \theta$. $$I=\int_0^{\pi/2} x^2\frac{\ln^2\cos x}{\sin^2x} \, dx = \frac{1}{4} \int_0^\infty\frac{(\arctan u)^2 \log^2(1+u^2)}{u^2} \, du$$ Put $$x=\arctan u$$

Closer form for $\int_0^\infty\frac{(\arctan{x})^2\log^2({1+x^2})}{x^2}dx$