Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
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.

share|cite|improve this answer
"...which is probably a useless result." LOL – Pedro Tamaroff Apr 10 '13 at 1:10
@PeterTamaroff Whenever I see the hypergeometric function appearing, I regard it to be useless :), probably because I never get to interact with them often. – user17762 Apr 10 '13 at 1:13
Note that this indefinite integral is discontinuous. A continuous one would not be periodic. – Robert Israel Apr 10 '13 at 1:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.