I saw the two identities
$$
-\log(\sin(x))=\sum_{k=1}^\infty\frac{\cos(2kx)}{k}+\log(2)
$$
and
$$
-\log(\cos(x))=\sum_{k=1}^\infty(-1)^k\frac{\cos(2kx)}{k}+\log(2)
$$
here: twist on classic log of sine and cosine integral. How can one prove these two identities?
Calculus – Fourier Series of Log Sine and Log Cos
calculusintegration
Related Solutions
$$\zeta(4):=\sum_{n=1}^\infty\frac{1}{n^4}=\frac{\pi^4}{90}\Longrightarrow \zeta_2(4):=\sum_{n=1}^\infty\frac{1}{(2n)^4}=\frac{1}{16}\zeta(4)=\frac{\pi^4}{16\cdot 90}\Longrightarrow$$
$$\Longrightarrow\sum_{n=0}^\infty\frac{1}{(2n+1)^4}=\zeta(4)-\zeta_2(4)=\frac{15}{16}\frac{\pi^4}{90}=\frac{\pi^4}{96}$$
And you have your first question answered.
Preliminaries
Looking at the real part of $\log\left(1-e^{ix}\right)$, we get $$ \log\left(2\sin\left(\frac x2\right)\right)=-\sum_{k=1}^\infty\frac{\cos(kx)}{k}\tag1 $$ Integrating by parts twice, we get $$ \int_0^{2\pi}x^2\cos(kx)\,\mathrm{d}x=\left\{\begin{array}{}\frac{8\pi^3}3&\text{if }k=0\\\frac{4\pi}{k^2}&\text{if }k\ne0\end{array}\right.\tag2 $$
In the derivations below, we use the values of $\zeta(2)$ and $\zeta(4)$ computed at the end of this answer.
Start to evaluate one sum, then get another:
$$
\begin{align}
\color{#C00}{\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{(k+j)^2kj}}
&=\sum_{j=1}^\infty\sum_{k=1}^\infty\left(\frac1{kj}-\frac1{k(k+j)}\right)\left(\frac1{kj}-\frac1{j(k+j)}\right)\tag{3a}\\[3pt]
&=\color{#00F}{\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{k^2}\frac1{j^2}}-2\color{#090}{\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{k^2(k+j)j}}+\color{#C00}{\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{(k+j)^2kj}}\tag{3b}\\
\color{#090}{\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{k^2(k+j)j}}
&=\frac12\color{#00F}{\zeta(2)^2}\tag{3c}\\[3pt]
&=\frac{\pi^4}{72}\tag{3d}
\end{align}
$$
Explanation:
$\text{(3a)}$: $\frac1{kj}-\frac1{k(k+j)}=\frac1{j(j+k)}$ and $\frac1{kj}-\frac1{j(k+j)}=\frac1{k(j+k)}$
$\text{(3b)}$: expand the products and separate the sums
$\phantom{\text{(3b):}}$ note that $\sum\limits_{j=1}^\infty\sum\limits_{k=1}^\infty\frac1{k^2(k+j)j}=\sum\limits_{j=1}^\infty\sum\limits_{k=1}^\infty\frac1{k(k+j)j^2}$
$\text{(3c)}$: cancel the red sums, move the green sum to the left side, and divide by $2$
$\text{(3d)}$: simplify
Evaluate the sum we started before (using the other sum we got before):
$$
\begin{align}
\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{(k+j)^2kj}
&=\sum_{j=1}^\infty\sum_{k=j+1}^\infty\frac1{k^2(k-j)j}\tag{4a}\\
&=\sum_{k=1}^\infty\sum_{j=1}^{k-1}\frac1{k^2(k-j)j}\tag{4b}\\
&=\sum_{k=1}^\infty\sum_{j=1}^{k-1}\frac1{k^3}\left(\frac1{k-j}+\frac1j\right)\tag{4c}\\
&=2\sum_{k=1}^\infty\left(\frac{H_k}{k^3}-\frac1{k^4}\right)\tag{4d}\\
&=2\sum_{k=1}^\infty\sum_{j=1}^\infty\frac1{k^3}\left(\frac1j-\frac1{j+k}\right)-2\zeta(4)\tag{4e}\\
&=2\sum_{k=1}^\infty\sum_{j=1}^\infty\frac1{k^2(k+j)j}-2\zeta(4)\tag{4f}\\
&=\frac{\pi^4}{36}-\frac{\pi^4}{45}\tag{4g}\\[6pt]
&=\frac{\pi^4}{180}\tag{4h}
\end{align}
$$
Explanation:
$\text{(4a)}$: substitute $k\mapsto k-j$
$\text{(4b)}$: swap order of summation
$\phantom{\text{(4b):}}$ (we include $k=1$ since the inner sum is then $0$)
$\text{(4c)}$: partial fractions
$\text{(4d)}$: $\sum\limits_{j=1}^{k-1}\frac1{k-j}=\sum\limits_{j=1}^{k-1}\frac1j=H_k-\frac1k$
$\text{(4e)}$: $H_k=\sum\limits_{j=1}^\infty\left(\frac1j-\frac1{j+k}\right)$
$\text{(4f)}$: simplify the summand
$\text{(4g)}$: apply $(3)$
$\text{(4h)}$: simplify
Putting The Preliminaries To Work
$$
\begin{align}
&\int_0^{2\pi}x^2\log\!\left(2\sin\left(\frac{x}2\right)\right)^2\,\mathrm{d}x\\
&=\int_0^{2\pi}x^2\sum_{j=1}^\infty\sum_{k=1}^\infty\frac{\cos(kx)}{k}\frac{\cos(jx)}{j}\,\mathrm{d}x\tag{5a}\\
&=\int_0^{2\pi}x^2\sum_{j=1}^\infty\sum_{k=1}^\infty\frac{\color{#C00}{\cos((k+j)x)}+\color{#090}{\cos((k-j)x)}}{2kj}\,\mathrm{d}x\tag{5b}\\
&=\color{#C00}{2\pi\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{(k+j)^2kj}}+\color{#090}{4\pi\sum_{j=1}^\infty\sum_{k=j+1}^\infty\frac1{(k-j)^2kj}+\frac{4\pi^3}3\sum_{k=1}^\infty\frac1{k^2}}\tag{5c}\\
&=2\pi\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{(k+j)^2kj}+4\pi\sum_{j=1}^\infty\sum_{k=1}^\infty\frac1{k^2(k+j)j}+\frac{4\pi^3}3\zeta(2)\tag{5d}\\
&=\frac{\pi^5}{90}+\frac{\pi^5}{18}+\frac{2\pi^5}9\tag{5e}\\[6pt]
&=\frac{13\pi^5}{45}\tag{5f}
\end{align}
$$
Explanation:
$\text{(5a)}$: apply $(1)$
$\text{(5b)}$: $\cos(a)\cos(b)=\frac{\cos(a+b)+\cos(a-b)}2$
$\text{(5c)}$: apply $(2)$
$\text{(5d)}$: substitute $k\mapsto k+j$ in the middle sum
$\text{(5e)}$: apply $(3)$ and $(4)$
$\text{(5f)}$: simplify
Best Answer
Recall that $$\cos(2kx) = \dfrac{e^{i2kx} + e^{-i2kx}}2.$$ Hence, $$\begin{aligned}\sum_{k=1}^{\infty} \dfrac{\cos(2kx)}k &= \sum_{k=1}^{\infty} \dfrac{e^{i2kx} + e^{-i2kx}}{2k} \\&= \dfrac12 \big(-\log (1-e^{i2x} )-\log (1-e^{-i2x} ) \big) \\&= - \dfrac12 \log \big(2 - 2\cos(2x) \big) \\&= - \dfrac12 \log\big(4 \sin^2(x)\big) \\&= - \log 2 - \log\big(\sin(x)\big).\end{aligned}$$ Hence, $$-\log\big(\sin(x)\big) = \sum_{k=1}^{\infty} \dfrac{\cos(2kx)}k + \log 2.$$ I leave it to you to similarly prove the other one. Both of these equalities should be interpreted $\pmod {2 \pi i}$.