Interesting log sine integrals $\int_0^{\pi/3} \log^2 \left(2\sin \frac{x}{2} \right)dx= \frac{7\pi^3}{108}$

Here's another approach for evaluating the one without the $x$ in front.

First notice that it's equivalent to showing that $$\int_{0}^{\pi /6} \log^{2}(2 \sin x) \ dx = \frac{7 \pi^{3}}{216}. $$

Using the principal branch of the logarithm and assuming that $0 < x < \pi$, we have $$ \begin{align} \log(1-e^{2ix}) &= \log (e^{-ix}-e^{ix}) + \log(e^{ix}) \\ &= \log(-2i \sin x) + ix \\ &= \log(2 \sin x) - \frac{i \pi}{2} + ix. \end{align}$$

Squaring both sides and integrating, $$\int_{0}^{\pi /6} \left(\log(2 \sin x) - \frac{i \pi}{2} + ix \right)^{2} \ dx = \int_{0}^{\pi /6} \log^{2} (1-e^{2ix}) \ dx . $$

Then equating the real parts on both sides of the equation, we get

$$\begin{align} \int_{0}^{\pi /6} \log^{2}(2 \sin x) \ dx &= \int_{0}^{\pi/6} \left(x- \frac{\pi}{2} \right)^{2} \ dx + \text{Re} \int_{0}^{\pi /6} \log^{2}(1-e^{2ix}) \ dx \\ &= \frac{19 \pi^{3}}{648} +\text{Re} \int_{C} \log^{2}(1-z) \frac{dz}{2iz} \\ &=\frac{19 \pi^{3}}{648} + \frac{1}{2} \ \text{Im} \int_{C} \frac{\log^{2}(1-z)}{z} \ dz \end{align}$$

where $C$ is the portion of the unit circle from $z=1$ to $z=e^{ \pi i /3}$.

But since $\frac{\log^{2}(1-z)}{z}$ is analytic for $\text{Re}(z) <1$,

$$ \begin{align} \int_{C} \frac{\log^{2}(1-z)}{z} \ dz &= \int_{1}^{e^{\pi i /3}} \frac{\log^{2}(1-z)}{z} \ dz . \end{align} $$

Then integrating by parts twice, we get

$$ \begin{align} \text{Im} \int_{1}^{e^{\pi i /3}} \frac{\log^{2}(1-z)}{z} \ dz &= \text{Im} \ \log^{2}(1-z) \log(z) \Bigg|^{e^{\pi i /3}}_{1} + 2 \ \text{Im} \int_{1}^{e^{\pi i /3}} \frac{\log(1-z) \log (z)}{1-z} \ dz \\ &= \text{Im} \ \log^{2}(e^{-\pi i /3}) \log(e^{\pi i /3}) + 2 \ \text{Im} \ \log(1-z) \text{Li}_{2}(1-z) \Bigg|^{e^{\pi i / 3}}_{1} \\ &+ 2 \ \text{Im} \int_{1}^{e^{\pi i / 3}} \frac{\text{Li}_{2}(1-z)}{1-z} \ dz \\ &=- \frac{ \pi^3}{27} - \frac{2 \pi }{3}\text{Im} \ i \ \text{Li}_{2} (e^{- \pi i /3}) - 2 \ \text{Im} \ \text{Li}_{3}(1-z) \Bigg|^{e^{\pi i/3}}_{1} \\ &= - \frac{ \pi^3}{27} - \frac{2 \pi }{3}\text{Im} \ i \ \text{Li}_{2} (e^{- \pi i /3}) - 2 \ \text{Im} \ \text{Li}_{3}(e^{ -\pi i /3}) \\ &= - \frac{\pi^3}{27} - \frac{2 \pi }{3} \sum_{n=1}^{\infty} \frac{\cos (n \pi /3)}{n^{2}} +2 \sum_{n=1}^{\infty} \frac{\sin (n \pi /3)}{n^3}. \end{align}$$

Integrating both sides of the Fourier series $$\sum_{n=1}^{\infty} \frac{\sin (k \theta)}{k} = \frac{\pi - \theta}{2} \ , \ 0 < \theta < 2 \pi$$

we get

$$\sum_{n=1}^{\infty} \frac{\cos (k \theta)}{k^{2}} = \frac{\theta^{2}}{4} - \frac{\pi \theta}{2} + \frac{\pi^{2}}{6} .$$

And integrating a second time, $$ \sum_{n=1}^{\infty} \frac{\sin (k \theta)}{k^{3}} = \frac{\theta^{3}}{12} - \frac{\pi \theta^{2}}{4} + \frac{\pi^{2} \theta}{6}.$$

Therefore,

$$\sum_{n=1}^{\infty} \frac{\cos (n \pi /3)}{n^{2}} = \frac{\pi^{2}}{36} $$

and $$ \sum_{n=1}^{\infty} \frac{\sin (n \pi /3)}{n^{3}} = \frac{5 \pi^{3}}{162}. $$

So finally we have

$$ \begin{align} \int_{0}^{\pi /6} \log^{2}(2 \sin x) \ dx &= \frac{19 \pi^{3}}{648} + \frac{1}{2} \left[ - \frac{ \pi^{3}}{27} - \frac{2 \pi }{3} \left(\frac{\pi^{2}}{36} \right) + 2 \left( \frac{5 \pi^{3}}{162} \right) \right] \\ &= \frac{7 \pi^{3}}{216} . \end{align}$$


The best way I see to do the simpler integral (the one without the $x$ in front) is to substitute $u=2 \sin{(x/2)}$ and expand the resulting integrand in a series. To wit, upon doing the substitution, we get

$$\int_0^{\pi/3} dx \: \log^2{[2 \sin{(x/2)}]} = \int_0^1 du \frac{\log^2{u}}{\sqrt{1-u^2/4}}$$

Note that

$$\frac{1}{\sqrt{1-u^2/4}} = \sum_{k=0}^{\infty} \frac{1}{2^{4 k}} \binom{2 k}{k} u^{2 k}$$

Then the integral becomes

$$\sum_{k=0}^{\infty} \frac{1}{2^{4 k}} \binom{2 k}{k} \int_0^1 du\: u^{2 k} \log^2{u}$$

The integral on the right may be done through integration by parts; the process is very interesting, but I leave it to the reader to get the nifty result that

$$\int_0^1 du\: u^{2 k} \log^2{u}=\frac{2}{(2 k+1)^3}$$

Therefore the evaluation of the integral becomes an evaluation of the following sum:

$$2 \sum_{k=0}^{\infty} \frac{1}{2^{4 k}} \binom{2 k}{k}\frac{1}{(2 k+1)^3}$$

To evaluate this sum, define

$$f(z) = 2 \sum_{k=0}^{\infty} \frac{1}{2^{4 k}} \binom{2 k}{k}\frac{z^{2 k+1}}{(2 k+1)^3}$$

The desired integral is $f(1)$. To derive an equation for $f$, recall the binomial series above:

$$\frac{d}{dz}\left [z \frac{d}{dz} \left [ z \frac{d}{dz} f(z)\right ] \right ] = 2 \sum_{k=0}^{\infty} \frac{1}{2^{4 k}} \binom{2 k}{k} z^{2 k} = \frac{2}{\sqrt{1-z^2/4}}$$

The resulting integrations are elementary except for the last one, which results in a nasty generalized hypergeometric function, something like

$$2 _4F_3\left(\frac{1}{2},\frac{1}{2},\frac{1}{2},\frac{1}{2},\frac{3}{2},\frac{3}{2},\frac{3}{2},\frac{1}{4}\right)$$

which in fact does numerically check out.