# How to find this integral : $\int_{0}^{\frac{\pi}{2}}(\ln(\sin{x}))^2dx$ [closed]

How to find this integral:$$\int_{0}^{\frac{\pi}{2}}\left(\ln(\sin{x})\right)^2\, dx$$ I tried to solve this by using integration by parts, but it become too complicated for me, I somewhere find its solution by using Fourier series but

I don't understand that (I am just a 1st year student). Help me!

• Maybe yoh want to comment smth about where did you find this integral? Commented Nov 27, 2022 at 17:06
• on youtube (michael penn ) he used its value for another integral without proof .... Commented Nov 27, 2022 at 17:09
• math.stackexchange.com/questions/121473/… Commented Nov 27, 2022 at 19:01
• Do you have a link to the video? Commented Nov 27, 2022 at 20:23
• I know you said you don't know about Fourier series, but you still might find "Integrate $\ln^3(\sin(x))$ using Fourier series" of interest. Your integral shows up while reducing the power of the log. Commented Nov 27, 2022 at 23:03

## 4 Answers

Let $$\displaystyle I:=\int_0^{\tfrac{\pi}{2}}\log^2(\sin x) \mathrm{d}x$$

$$\displaystyle I=\int_0^{\tfrac{\pi}{4}}\log^2(\sin x) \mathrm{d}x+\int_{\tfrac{\pi}{4}}^{\tfrac{\pi}{2}}\log^2(\sin x) \mathrm{d}x$$

In the second integral, set $$u=\dfrac{\pi}{2}-x$$,

$$\displaystyle I=\int_0^{\tfrac{\pi}{4}}\log^2(\sin x) \mathrm{d}x+\int_{0}^{\tfrac{\pi}{4}}\log^2(\cos x) \mathrm{d}x$$

$$\displaystyle 2I=\int_0^{\tfrac{\pi}{4}}\Big(\log(\sin x)+\log(\cos x)\Big)^2 \mathrm{d}x+\int_0^{\tfrac{\pi}{4}}\Big(\log(\sin x)-\log(\cos x)\Big)^2 \mathrm{d}x$$

$$\displaystyle \int_0^{\tfrac{\pi}{4}}\Big(\log(\sin x)+\log(\cos x)\Big)^2 dx=\int_0^{\tfrac{\pi}{4}}\Big(\log(\sin(2x))-\log 2\Big)^2 \mathrm{d}x$$

Consider the RHS and set $$t=2x$$,

$$\displaystyle \int_0^{\tfrac{\pi}{4}}\Big(\log(\sin(2x))-\log 2\Big)^2 \mathrm{d}x=\dfrac{1}{2}I-\log 2 \int_0^{\tfrac{\pi}{2}}\log(\sin x)\mathrm{d}x+\dfrac{1}{2}\int_0^{\tfrac{\pi}{2}}(\log 2)^2\mathrm{d}x$$

Since:

$$\displaystyle \int_0^{\tfrac{\pi}{2}}\log(\sin x)\mathrm{d}x=-\dfrac{\pi}{2}\log 2$$

$$\displaystyle \int_0^{\tfrac{\pi}{4}}\Big(\log(\sin x)-\log(\cos x)\Big)^2 \mathrm{d}x=\dfrac{\pi^3}{16}$$

It follows

$$\displaystyle 2I=\dfrac{1}{2}I+\dfrac{\pi}{2}\log^2 2+\dfrac{\pi}{4}\log^2 2+\dfrac{\pi^3}{16}$$

$$\displaystyle I=\dfrac{1}{3}\left(\dfrac{3\pi}{2}\log^2 2+\dfrac{\pi^3}{8}\right)$$

• Very helpful , thanks Commented Nov 28, 2022 at 1:40
• Actually I was having problem in proving :$\int_0^\frac{\pi}{4}(\log(\sin {x})-\log(\cos{ x }))^2dx=\frac{\pi^3}{16}$ can you prove this ??? Commented Nov 28, 2022 at 12:38
• Take a look here math.stackexchange.com/questions/3213047/… Commented Nov 28, 2022 at 13:02

$$\newcommand{\d}{\mathrm{d}}$$The mathematics that drives many polygamma identities is non-trivial, perhaps the most complicated compared to other techniques shown here, but once you know the results (whether or not you care about their derivation) they make integration much easier! See this and this for the results (not the proofs). This method happily generalises to arbitrary natural exponents, e.g. I could use this approach to (very tediously) express: $$\int_0^1\log^{10}(\sin x)\,\d x$$In terms of the Euler-Mascheroni constant, $$\pi$$ and integer values of the Riemann zeta function.

Let $$x\mapsto\arcsin(x)$$ and $$x\mapsto\sqrt{x}$$ in two successive substitutions to get the equivalent problem: $$\frac{1}{8}\int_0^1\frac{\log^2x}{\sqrt{x}\sqrt{1-x}}\,\d x=\frac{1}{8}\int_0^1\log^2(x)(1-x)^{-1/2}x^{-1/2}\,\d x$$Consider the function: \begin{align}J:(-1/2,\infty)&\longrightarrow\Bbb R\\s&\mapsto\frac{1}{8}\int_0^1x^{s-1/2}(1-x)^{-1/2}\,\d x=\frac{1}{8}\mathfrak{B}\left(s+\frac{1}{2},\frac{1}{2}\right)=\frac{\sqrt{\pi}}{8}\frac{\Gamma(s+1/2)}{\Gamma(s+1)}\end{align}Where appears the beta and gamma functions. Now, using the polygamma functions: $$J'(s)=\frac{\sqrt{\pi}}{8}\frac{\Gamma(s+1/2)}{\Gamma(s+1)}(\psi(s+1/2)-\psi(s+1))\\J''(s)=\frac{\sqrt{\pi}}{8}\frac{\Gamma(s+1/2)}{\Gamma(s+1)}[(\psi(s+1/2)-\psi(s+1))^2+[\psi^{(1)}(s+1/2)-\psi^{(1)}(s+1)]]$$Since: $$J''(0)=\frac{1}{8}\int_0^1\frac{\log^2(x)}{\sqrt{x}\sqrt{1-x}}\,\d x=\int_0^1\log^2(\sin x)\,\d x$$We just need to evaluate the above at $$s=0$$. This gives: $$\frac{\pi}{8}[(-\gamma-2\log2-(-\gamma))^2+(\pi^2/2-\pi^2/6)]=\frac{\pi}{2}\log^22+\frac{\pi^3}{24}$$Using knowledge of the Basel problem, the Gauss multiplication theorem and general familiarity with polygamma identities.

• It helps a lot , thanks Commented Nov 28, 2022 at 1:33

For what it's worth, here's a solution with Fourier series. I know you said you don't understand it, but let's see if I can make it clearer for you.

If a function $$f$$ defined on $$(0, 2\pi)$$ is square integrable on that interval, then you can compute its Fourier coefficients: $$a_n=\frac 1 {\pi}\int_{0}^{2\pi}f(x)\cos(nx)dx \,\,\text{ and } \,\,b_n=\frac 1 {\pi}\int_{0}^{2\pi}f(x)\sin(nx)dx$$ Moreover, by the Plancherel-Parseval theorem, the $$L^2$$ norm of that function on $$(0, 2\pi)$$ is equal to the sum of the squares of the Fourier coefficients. That means: $$\frac 1 \pi \int_0^{2\pi} |f(x)|^2dx = \frac {a_0^2} 2 +\sum_{n\geq 1}(a_n^2+b_n^2)$$

Now, consider the function $$f:x\mapsto \ln \sin \left(\frac x2\right)$$ on $$(0, 2\pi)$$. It is square integrable on that interval. You can verify that $$a_0=2\ln 2 \,\text{ and }\, a_n=\frac 1 n \,\text{ and }\, b_n=0\,\text{ for all }n\geq 1$$ Applying Plancherel gives

$$\frac 1 {\pi} \int_0^{2\pi}\left(\ln \sin \frac x2\right)^2dx = 2\ln^2 2 + \sum_{n\geq 1}\frac 1 {n^2}\tag{1}$$ Also, it is known that $$\sum_{n\geq 1} \frac 1 {n^2} = \frac {\pi^2}6\tag{2}$$ Thus, combining $$(1)$$ and $$(2)$$, we obtain $$\int_0^{2\pi}\left(\ln \sin \frac x2\right)^2dx = 2\pi \ln^2 2 + \frac{\pi^3}{6}$$ Changing the variable $$x\rightarrow 2x$$ and using symmetries gives $$\begin{split} \int_{0}^{2\pi} \left(\ln \sin \frac x2\right)^2dx&=2\int_0^\pi \left(\ln \sin x\right)^2dx\\ &=2\left ( \int_0^{\frac \pi 2} \left(\ln \sin x\right)^2dx+\int_{\frac \pi 2}^\pi \left(\ln \sin x\right)^2dx\right)\\ &=4 \int_0^{\frac \pi 2} \left(\ln \sin x\right)^2dx \end{split}$$ We conclude $$\boxed{\int_0^{\frac \pi 2}\left(\ln \sin x\right)^2dx = \frac \pi 2 \ln^2 2 + \frac{\pi^3}{24}}$$

Using $$\log(\sin x)=-\log2-\sum_{n=1}^\infty\frac{\cos(2nx)}{n}$$ one has $$\begin{eqnarray} I&=&\int_0^{\tfrac{\pi}{2}}\log^2(\sin x) \mathrm{d}x\\ &=&\int_0^{\tfrac{\pi}{2}}\bigg[-\log2+\sum_{n=1}^\infty\frac{\cos(2nx)}{n}\bigg]^2 \mathrm{d}x\\ &=&\frac\pi2\log^22+\sum_{n=1}^\infty\int_0^{\tfrac{\pi}{2}}\frac{\cos^2(2nx)}{n^2} \mathrm{d}x\\ &=&\frac\pi2\log^22+\frac{\pi}{4}\sum_{n=1}^\infty\frac{1}{n^2}\\ &=&\frac\pi2\log^22+\frac{\pi^3}{24} \end{eqnarray}$$

• This is the same as my answer. Commented Nov 28, 2022 at 21:15
• Sorry, I didn't see your answer clearly. Commented Nov 28, 2022 at 21:49