How to evaluate $I=\int\limits_0^{\pi/2}\frac{x\log{\sin{(x)}}}{\sin(x)}\,dx$

I want to suggest a partial solution which i call "partial" because some of the work is done using Mathematica but i hope i can fill this gaps in the next time.

Lets define the complex valued function $f(z)=z\frac{\log(\sin(z))}{(\sin(z))}$. We want to integrate it around a rectangle with vertices $(0,0)$,$(\pi/2,0)$, $(\pi/2,\pi/2+i \infty)$ and $(0,\pi/2+i \infty)$. We also implicitly assume a small indent around $(0,0)$. Now by using Cauchy's integral theorem we can write $$ \int_Cf(z)dz=\int_{0}^{\pi/2}\frac{x \log(\sin(x))}{\sin(x)}dx+ i\int_{0}^{\infty}\frac{iy \log(\sin(i y))}{\sin(i y)}dy+i\int_{0}^{\infty}\frac{(iy+\pi/2)\log(\sin(iy+\pi/2 ))}{\sin(iy+\pi/2)}dy=0 $$

Were we used the fact the the integral vanishs at the top of the rectangle (This contribution goes as $R^2 e^{-R}$ for big $R$) as well as the contribiution stemming from the small indent around zero (This contribution behaves as $\epsilon \log(\epsilon$) near the origin).

Now using the identities $\sin(iy+\pi/2)=\cosh(y)$ and $\sin(iy)=i\sinh(y)$ This can be rewritten as $$ \int_Cf(z)=\int_{0}^{\pi/2}\frac{\log(\sin(x))}{\sin(x)}dx+ i\underbrace{\int_{0}^{\infty}\frac{y (\log\sinh( y)+i \pi/2)}{\sinh(y)}dy}_{I_1}+i\underbrace{\int_{0}^{\infty}\frac{(iy+\pi/2)\log(\cosh(y))}{\cosh(y)}dy}_{I_2}=0 $$

Here we choose the standard branch of the logarithm.

Splitting $I_1$ and $I_2 $ we are now down to the four integrals

$$ J_1=\int_{0}^{\infty}\frac{y\log(\sinh(y))}{\sinh(y)}dy\\ J_2=\int_{0}^{\infty}\frac{y}{\sinh(y)}dy\\ J_3=\int_{0}^{\infty}\frac{y\log(\cosh(y))}{\cosh(y)}dy\\ J_4=\int_{0}^{\infty}\frac{\log(\cosh(y)}{\cosh(y)}dy $$

Now let's perform a chain of substitutions $r=e^{y}$ and $r^2=q$ in the integrals involving $\cosh$ and $r=e^{-y}$ and $r^2=q$ in the integrals involving $\sinh$ after some tedious algebra we end up with: $$ J_1= \frac{1}{2}\int_{0}^{1}\frac{\frac{1}{4}\log(q)^2-\frac{1}{2}\log(q)\log(1-q)+\frac{1}{2}\log(q)\log(2)}{(1-q)\sqrt{q}}dq\\ J_2=\frac{1}{2}\int_{0}^{1}\frac{-\log(q)}{(1-q)\sqrt{q}}dq\\ J_3=\frac{1}{2}\int_{1}^{\infty}\frac{\frac{1}{2}\log(q)(\log(2)-\frac{1}{2}\log(q)+\log(1+q)}{(1+q)\sqrt{q}}dq\\ J_4=\frac{1}{2}\int_{1}^{\infty}\frac{(\log(2)-\frac{1}{2}\log(q)+\log(1+q)}{(1+q)\sqrt{q}}dq $$

The first two integrals can easily solved by using the identity

$$ \int_{0}^{1}\frac{\log^n(1-t)\log^m(t)}{(1-t)^vt^w}dt=\partial^n_{\alpha}\partial^m_{\beta}\int_{0}^{1}(1-t)^{\alpha-v}t^{\beta-w}dt|_{\alpha=\beta=0}=\partial^n_{\alpha}\partial^m_{\beta}\frac{\Gamma[1 + \beta + v] \Gamma[1 + \alpha + w]}{\Gamma[2 + \alpha + \beta + v + w]}\big|_{\alpha=\beta=0} $$

Here $\Gamma[z]$ denotes Euler's Gamma function.

Please note that we implicitly assume that this expression exists, which is of course not the case for every choice of parameters.

For the other two integrals i'm not sure how to perform them (I suspect they can somehow be reduced to explicit integral representations of the dilogarithm), but they can be obtained in Mathematica.

We get $$ J_1=\frac{\pi^2 \log(2)}{8}\\ J_2=\frac{\pi^2}{8}\\ J_3=\frac{1}{96} \left(-2 i \left(-192 \text{Li}_3\left(\frac{1}{2}+\frac{i}{2}\right)+105 \zeta (3)+4 \log ^3(2)\right)+15 \pi ^3+12 \pi \log ^2(2)+10 i \pi ^2 \log (2)\right)\\ J_4= \frac{2 \pi \log(2)}{4} $$

Now merging everything together we obtain $$ I=-I_1-I_2=\frac{1}{96} \left(-2 i \left(-192 \text{Li}_3\left(\frac{1}{2}+\frac{i}{2}\right)+105 \zeta (3)+4 \log ^3(2)\right)+3 \pi ^3+12 \pi \log ^2(2)+2 i \pi ^2 \log (32)\right) $$

or $$ I\approx-1.12269 $$

as expected from numerical calculations

PS: I would highly appreciate any hint how to perform $J_3$

Appendix: Calculation of $J_4$

I finally found a way to at least calculate $J_4$

Starting from the original definition and using $y=e^q$ and $q=1/x$ one realizes that the integral can be rewritten as

$$ J_4/2=\int_{1}^{\infty}\frac{-\log(2)}{x^2+1}dx+\frac{1}{2}\int_{0}^{\infty}\frac{-\log(x)+\log(x^2+1)}{x^2+1}dx $$

The first one is a standard integral and equal to $-\log(2)\frac{\pi}{2}$ the third one is easily evaluated using a dogbone contour and yields $0$ So it remains to calculate $$ \int_{0}^{\infty}dx\frac{\log(x^2+1)}{x^2+1} $$

Using the identiy $$\log(1+x^2)=\int_{0}^1 da \frac{x^2}{1+ax^2}$$ this is equal to

$$ \int_{0}^1 da \int_{0}^{\infty}dx\frac{x^2}{(x^2+1)(1+ax^2)} = \int_{0}^1 da\frac{\pi }{2 \left(a+\sqrt{a}\right)}=\pi \log (2) $$

Plugging everything together yields

$$ J_4=\frac{\pi}{2}\log[2] $$

as expected.

So only $J_3$ remains...


The answer is shown to be a fairly simple series and Mathematica identifies that series with a hypergeometric function. I have verified Mathematica's claim and used Mathematica to evaluate the hypergeometric function.


In this answer, it is shown that $$ \sum_{k=0}^\infty\frac1{(2k+1)}\frac{4^k}{\binom{2k}{k}}x^{2k+1} =\frac{\sin^{-1}(x)}{\sqrt{1-x^2}}\tag{1} $$ Furthermore, integration by parts shows that $$ \int_0^1x^n\log(x)\,\mathrm{d}x=-\frac1{(n+1)^2}\tag{2} $$ Substituting $u=\sin(x)$, we get $$ \begin{align} \int_0^{\pi/2}\frac{x\log(\sin(x))}{\sin(x)}\,\mathrm{d}x &=\int_0^1\frac{\sin^{-1}(u)}{\sqrt{1-u^2}}\frac{\log(u)}u\,\mathrm{d}u\\ &=\int_0^1\sum_{k=0}^\infty\frac1{(2k+1)}\frac{4^k}{\binom{2k}{k}}u^{2k}\log(u)\,\mathrm{d}u\\ &=-\sum_{k=0}^\infty\frac1{(2k+1)^3}\frac{4^k}{\binom{2k}{k}}\tag{3} \end{align} $$ Mathematica identifies $(3)$ with the hypergeometric function $$ \bbox[5px,border:2px solid #A0A0A0]{-{\vphantom{\mathrm{F}}}_4\mathrm{F}_3\left(\color{#C00000}{\tfrac12,\tfrac12},\color{#00A000}{1},\color{#F0A000}{1};\color{#0000FF}{\tfrac32,\tfrac32,\tfrac32};1\right)}\tag{4} $$ This can easily be verified by looking at the ratios of the terms in $(3)$: $$ \overbrace{4\vphantom{\frac{()^2}{()}}}^{4^k}\cdot\overbrace{\frac{(k+1)^2}{(2k+2)(2k+1)}}^{1/\binom{2k}{k}}\cdot\overbrace{\frac{(2k+1)^3}{(2k+3)^3}}^{1/(2k+1)^3} =\frac{\color{#C00000}{(k+\frac12)^2}\color{#00A000}{(k+1)}}{\color{#0000FF}{(k+\frac32)^3}}\cdot1\tag{5} $$ The orange $1$ cancels the $k!$ in the denominator of the definition of the hypergeometric functions.

Mathematica evaluates $(4)$ as $$ \bbox[5px,border:2px solid #A0A0A0]{-1.12269002473064449758427221442}\tag{6} $$


The closed form of the integral $$\int_0^{\pi/2}\frac{x\log{\sin{(x)}}}{\sin(x)}\,dx.$$

Also note the second integral, that is $$\int_0^{\pi/2}\frac{x\log{\sin{(x)}}}{\sin(2x)}\,dx$$ can be easily evaluated by combining $2$ integrations by parts (to get again the integral we started with) and beta function.