Evaluate $\int_0^{\pi/2}\frac{x^2\log^2{(\sin{x})}}{\sin^2x}dx$ How  evaluate this integral?
 $$I=\int_0^{\pi/2}\frac{x^2\log^2{(\sin{x})}}{\sin^2x}\,dx$$
 Note: $$\int_0^{\pi/2}\frac{x^2\log{(\sin x)}}{\sin^2x}dx=\pi\ln{2}-\frac{\pi}{2}\ln^22-\frac{\pi^3}{12}.$$ 
 A: $$I=\frac\pi3\ln^32-\pi\ln^22+2\pi\ln2+\frac{\pi^3}6\left(\ln2-1\right)+\frac\pi8\zeta(3)$$
A: Since
$$\log(2\sin x)=-\sum_{k\geq 1}\frac{\cos(2kx)}{k}\tag{1}$$
it follows that:
$$\log^2(2\sin x)=\sum_{j,k\geq 1}\frac{\cos(2kx)\cos(2jx)}{kj}=\frac{1}{2}\sum_{j,k\geq 1}\frac{\cos(2(k+j)x)+\cos(2(k-j)x)}{kj}$$
where:
$$\sum_{j,k\geq 1}\frac{\cos(2(k+j)x)}{kj}=\sum_{n\geq 2}\cos(2nx)\sum_{h=1}^{n-1}\frac{1}{h(n-h)}=\sum_{n\geq 2}\frac{2 H_{n-1}}{n}\cos(2nx),$$
$$\sum_{k\geq j\geq 1}\frac{\cos(2(k-j)x)}{kj}=\sum_{n\geq 0}\cos(2nx)\sum_{j=1}^{+\infty}\frac{1}{j(n+j)}=\zeta(2)+\sum_{n\geq 1}\frac{H_n}{n}\cos(2nx),$$
so:
$$\log^2(2\sin x) = \frac{\pi^2}{3}+\sum_{n\geq 1}\frac{H_{n-1}+H_n}{n}\,\cos(2nx)\tag{2}$$
and we just need to find:
$$ J_n = \frac{4}{\pi}\int_{0}^{\pi/2}\frac{x^2}{\sin^2 x}\cos(2nx)\,dx \tag{3}$$
to turn the computation of the integral into a computation of a series. Now:
$$ J_n = -\frac{16}{\pi}\cdot\Re\int_{0}^{\pi/2}\frac{x^2 e^{2nix}}{(e^{ix}-e^{-ix})^2}\,dx\tag{4}$$
and since:
$$\frac{x^2 e^{2(n-1)ix}}{(1-e^{-2ix})^2}=x^2 e^{2(n-1)ix}\left(1+2e^{-2ix}+3e^{-4ix}+4e^{-6ix}+\ldots\right),$$
$$\Re\int_{0}^{\pi/2}x^2 e^{2mix}\,dx = (-1)^m\frac{\pi}{m^2},$$
it follows that:
$$\begin{eqnarray*} J_n &=&4\log 2-n\frac{\pi^2}{3}-4\sum_{k=1}^{n-1}(n-k)\frac{(-1)^k}{k^2}\\&=&4n\sum_{k\geq n}\frac{(-1)^k}{k^2}-4\sum_{k\geq n}\frac{(-1)^k}{k}\tag{5}\end{eqnarray*} $$
The plan, now, is to exploit partial summation through the identities:
$$ \sum_{k=1}^{n}\frac{H_{k-1}}{k}=\frac{1}{2}\left(H_n^2-H_n^{(2)}\right), \qquad \sum_{k=1}^{n}\frac{H_{k}}{k}=\frac{1}{2}\left(H_n^2+H_n^{(2)}\right), $$
$$ \sum_{k=1}^{n}H_k = n H_n - \sum_{k=1}^{n-1}\frac{k}{k+1} = n H_n -n + H_n.$$
Continues.
