# Integral of $\ln |\sin(x)|$

Does anyone have a real formula for the integral $$\int\ln |\sin(x)|\,dx ?$$ Neither Maple nor Mathematica give a real answer.

Using integration by parts and the series for $x\cot x$, I get $$x\ln |\sin(x)|-\sum_{k=0}^\infty(-1)^k\frac{2^{2k}B_{2k}}{(2k+1)!}x^{2k+1}+C$$ where $B_{2k}$ are Bernoulli numbers. Does anyone recognize this function?

-
The usual way would be to break into intervals, where $\sin x > 0$ and where $\sin x < 0$. – GEdgar Apr 10 '13 at 0:57
Maxima gives an answer that involves complex numbers. What is the problem? – vonbrand Apr 10 '13 at 1:02
In case it helps, without absolute value, WolframAlpha gives an answer using polylogarithm. – Jean-Claude Arbaut Apr 10 '13 at 7:21
@arbautjc has the answer, more or less. Remember that $\log|\sin\,x|$ is $\pi$-periodic, so take the integral expression across $(0,\pi)$ and add a step function. – J. M. Apr 11 '13 at 3:20
But it is in complex form. – TCL Apr 11 '13 at 4:18

We have $\vert \sin(x) \vert = \left(1-\cos^2(x)\right)^{1/2}$. Hence, we have have $$\ln \vert \sin(x) \vert = \dfrac12 \ln \left(1-\cos^2(x)\right) = -\dfrac12 \sum_{k=1}^{\infty} \dfrac{\cos^{2k}(x)}k$$ Now $$\int \cos^{2k}(x) dx = a(x) \cdot \dfrac{\cos^{2k+1}(x)}{2k+1} \cdot F^1_2(1/2,k+1/2,k+3/2,\cos^2(x))$$ where $a(x) = \begin{cases} -1 & \text{if }x \pmod {2\pi} \in [0, \pi)\\ +1 & \text{if }x \pmod{2 \pi} \in [\pi, 2\pi)\end{cases}$ and $F_2^1$ is the hypergeometric function defined here.
Hence, we get that $$\int \ln \vert \sin(x) \vert = -\dfrac{a(x)}2 \sum_{k=1}^{\infty} \dfrac{\cos^{2k+1}(x)}{k(2k+1)}F^1_2(1/2,k+1/2,k+3/2,\cos^2(x)) + \text{constant}$$ which is probably a useless result.