# Indefinite integral of $\log(\sin(x))$

I'm computing the indefinite integral of $\log(\sin(x))$; this is the my solution with integration by substitution:

$\int\log(\sin(x))dx = \int\log(y)\frac{1}{\cos(x)}dy = \frac{1}{\cos(x)}\int\log(y)dy = \frac{1}{\cos(x)}(y\log(y)-y) = \tan(x)\log(\sin(x))-\tan(x)$

Because I did the substitution $y=\sin(x), dy=\cos(x)dx\rightarrow dx=\frac{dy}{cos(x)}$.

Wolfram online gives a different result; where is the my error?

• The $\;\frac1{\cos x}\;$ is actually a function of the new variable $\;y\;$ : you can't take it out of the integral. – DonAntonio Jul 23 '13 at 18:48
• This does not have an elementary antiderivative. – Cameron Williams Jul 23 '13 at 18:48
• You can not take $\cos x$ out of the integral and you have to transform $\cos x$ by putting $x=\sin^{-1}y$ there. – Samrat Mukhopadhyay Jul 23 '13 at 18:48

$\cos(x)$ is not a constant, because $x$ depends on $y$, so you can't pull $\cos(x)$ out of the integral.
As Cameron said, this indefinite integral is not elementary. Maple does it in terms of a dilogarithm... $$\int \ln \left( \sin \left( x \right) \right) \,{dx}= -x\ln \left( 1-{{\rm e}^{2\,ix}} \right) +x\ln \left( \sin \left( x \right) \right) +\frac{i{x}^{2}}{2}+\frac{i\,{\rm Li_2} \left( {{\rm e} ^{2\,ix}} \right)}{2}$$