# Calculating $\int\sin(x)\ln(\sin(x))\, \mathrm{d}x$

I was solving indefinite integrals for preparing me to a math test but I found a very hard one I'm not able to solve. It is

$$\int \sin(x)\ln(\sin(x))\, \mathrm{d}x$$

I tried to solve it by substitution but I wasn't able to express the $dx$ with a smart method. The only way I can think to solve it is by parts but it would be too much difficult in my opinion.

I hope you can help me even with an advice, thanks in advance.

If you let $u=\ln(\sin(x))$ and $dv=\sin(x)\,dx$, then $du=\dfrac{\cos(x)}{\sin(x)}$ and $v=-\cos(x)$. You get \begin{align*}\int&=-\cos(x)\ln(\sin(x))+\int\cos(x)\,\frac{\cos(x)}{\sin(x)}\,dx\\ &=-\cos(x)\ln(\sin(x))+\int\frac{\cos^2(x)}{\sin(x)}\,dx\\ &=-\cos(x)\ln(\sin(x))+\int\frac{1-\sin^2(x)}{\sin(x)}\,dx \\ &=-\cos(x)\ln(\sin(x))+\int[\csc(x)-\sin(x)]\,dx. \end{align*} These last two integrals succumb to standard, known methods.

$$\int \sin(x)\log\sin(x)\,dx\stackrel{x\mapsto\arcsin u}{=}\int\frac{u}{\sqrt{1-u^2}}\log(u)\,du\stackrel{\text{IBP}}{=}-\sqrt{1-u^2}\log u+\int\frac{\sqrt{1-u^2}}{u}\,du$$ (or just the tangent half-angle substitution) leads to $$\int \sin(x)\log\sin(x)\,dx = C+\cos(x)-\cos(x)\log\sin(x)+\log\tan\left(\frac{x}{2}\right).$$

Integrate by parts : ${\int}\mathtt{f}\mathtt{g}' = \mathtt{f}\mathtt{g} - {\int}\mathtt{f}'\mathtt{g}$ where $\mathtt{f} =\ln\left(\sin\left(x\right)\right)$ and $\mathtt{g'} =\sin\left(x\right)$. Thus :

$$\int \sin(x)\ln(\sin(x))\, \mathrm{d}x=-\cos\left(x\right)\ln\left(\sin\left(x\right)\right)-{\displaystyle\int}-\dfrac{\cos^2\left(x\right)}{\sin\left(x\right)}\,\mathrm{d}x$$

Now, solving :

$${\displaystyle\int}-\dfrac{\cos^2\left(x\right)}{\sin\left(x\right)}\,\mathrm{d}x = -\int \dfrac{\cos^2\left(x\right)}{\sin\left(x\right)}\,\mathrm{d}x =-{\displaystyle\int}\dfrac{1-\sin^2\left(x\right)}{\sin\left(x\right)}\,\mathrm{d}x$$

$$=$$

$$=-{\displaystyle\int}\left(\csc\left(x\right)-\sin\left(x\right)\right)\mathrm{d}x =-\bigg\{{\displaystyle\int}\csc\left(x\right)\,\mathrm{d}x-{\displaystyle\int}\sin\left(x\right)\,\mathrm{d}x\bigg\}$$

$$=$$

$$=\ln\left(\csc\left(x\right)+\cot\left(x\right)\right) -\cos\left(x\right)$$

By plugging in to the initial integral, we yield :

$$\int \sin(x)\ln(\sin(x))\, \mathrm{d}x=-\cos\left(x\right)\ln\left(\sin\left(x\right)\right)-\ln\left(\csc\left(x\right)+\cot\left(x\right)\right)+\cos\left(x\right) +C$$

The problem is solved. Apply the absolute value function to arguments of logarithm functions in order to extend the antiderivative's domain and you should yield the expression :

$$\int \sin(x)\ln(\sin(x))\, \mathrm{d}x=-\ln\left(\left|\csc\left(x\right)+\cot\left(x\right)\right|\right)-\cos\left(x\right)\left(\ln\left(\sin\left(x\right)\right)-1\right)+C$$

I thought it might be instructive to present an approach that avoids integration by parts or substitution and relies instead on exploiting the double angle formula for the sine function and recognizing the resulting Riemann-Stieltjes integrals. To that end we proceed.

Using the double angle formula for the sine function, $\sin(x)=2\sin(x/2)\cos(x/2)$, we can write

\begin{align} \int \sin(x)\log(\sin(x))\,dx&=\int 2\sin(x/2)\cos(x/2)\log(2\sin(x/2)\cos(x/2))\\\\ &=\log(2)\int \sin(x)\,dx+2\int \sin(x/2)\cos(x/2)\log(\sin(x/2)\,dx\\\\ &+2\int \sin(x/2)\cos(x/2)\log(\sin(x/2)\,dx\\\\ &=-\log(2)\cos(x)+4\underbrace{\int \sin(x/2)\log(\sin(x/2))\,d(\sin(x/2))}_{\text{A Riemann-Stieltjes Integral}}\\\\ &-4\underbrace{\int \cos(x/2)\log(\cos(x/2))\,d(\cos(x/2))}_{\text{Another Riemann Stieltjes Integral}}+C\\\\ &=-\log(2)\cos(x)+\sin^2(x/2)(2\log(\sin(x/2))-1)\\\\ &-\cos^2(x/2)(2\log(\cos(x/2))-1)+C\\\\ &\overbrace{=}^{\text{Simplifying}}\log(\tan(x/2))-\cos(x)\log(\sin(x)/e)+C \end{align}

• Please let me know how I can improve my answer. I really want to give you the best answer I can. – Mark Viola Jul 21 '18 at 18:21

In this particular case you can set $u=\cos(x)$ to get rid of $\sin(x)\mathop{dx}=-\mathop{du}$

Then use $\sin(x)=\sqrt{1-u^2}$ and the logarithm will get rid of the square root and split nicely the product $(1-u)(1+u)$.

It becomes $$\int -\frac 12\ln(1-u^2)\mathop{du}=-\frac 12\left(\int \ln(1+u)\mathop{du}+\int\ln(1-u)\mathop{du}\right)$$

Then use antiderivative of $\int\ln(u)=u\ln(u)-u$

Hint

Use integration by parts and call: $u=\log (\sin x)$ and $dv=\sin x dx$, so:

$$\int \sin x \log (\sin x)dx=\int u dv=uv-\int v du$$

where, $v=-\cos x$ and $du=\cos x\cdot \frac{1}{\sin x}$

$$I=\int \sin (x)\ln \left( \sin (x)\right) dx\rightarrow \left\{ \begin{array}{lcc} u=\ln (\sin (x)) \\ \\ dv=\sin (x)dx \end{array} \right.\rightarrow \left\{ \begin{array}{lcc} du=\dfrac{\cos (x)}{\sin (x)}dx \\ \\ v=-\cos (x) \end{array} \right.$$ $$I=-\cos (x)\ln (\sin (x))+\overbrace{\int \dfrac{\cos^2 (x)}{\sin (x)}dx}^H$$ $$t=\cos (x)\rightarrow dt=(-\sin (x))dx\rightarrow \dfrac{\cos^2 (x)}{\sin (x)}dx=-\dfrac{t^2}{\sin^2 (x)}dt=\dfrac{t^2}{t^2-1}dt$$ $$H=\int \dfrac{t^2-1+1}{t^2-1}dt=\int \left( 1-\dfrac{\frac{1}{2}}{t+1}+\dfrac{\frac{1}{2}}{t-1}\right)dt=t+\dfrac{1}{2}\left[ \ln |t-1|-\ln |t+1|\right]=$$ $$=t+\ln \sqrt{\left| \dfrac{t-1}{t+1}\right|}=\cos (x)+\ln \sqrt{\dfrac{1-\cos (x)}{1+\cos (x}}$$

$$\boxed{I=-\cos (x)\ln (\sin (x))+\cos (x)+\ln \sqrt{\dfrac{1-\cos (x)}{1+\cos (x)}}+C}$$