# Integrate Square of Log-Sine

#### The Lord

##### New member
Prove that

$$\int_0^{\pi/2} (\log \sin x )^2 dx = \frac{1}{24} \left(\pi ^3+12 \pi \log^2(2)\right)$$

#### sbhatnagar

##### Active member
Hi! I think I know how to solve this integral but my method is a little tedious. Anyway I will post my solution.

Let $\displaystyle I(n) = \int_0^{\pi/2}\sin ^n (x)dx$

$I(n)$ can be evaluated in terms of gamma function.

$$I(n)= \int_0^{\pi/2}\sin ^n (x)dx = \frac{\sqrt{\pi} \Gamma \left( \frac{1+n}{2}\right)}{2\Gamma \left( 1+\frac{n}{2}\right)}$$

Differentiating with respect to n

$$I'(n) = \int_0^{\pi/2}\sin^n (x) \log(\sin x) dx = \\ \frac{\sqrt{\pi} \Gamma \left( \frac{1+n}{2}\right)}{4\Gamma \left( 1+\frac{n}{2}\right)} \left( \psi \left( \frac{1+n}{2}\right) -\psi\left( 1+\frac{n}{2}\right)\right) \tag{1}$$

Let n=0

$$I'(0) = \int_0^{\pi/2}\log(\sin x)dx = \frac{\sqrt{\pi} \sqrt{\pi}}{4} \left( \gamma -\gamma -2\ln(2)\right) = \frac{-\pi}{2}\ln(2)$$

$\gamma$ is the Euler-Mascheroni Constant. For the Square of Log-Sine we must differentiate (1) again.

$$I''(n)=\int_0^{\pi/2}\sin^n(x) (\log(\sin x))^2 dx = \frac{\sqrt{\pi } \Gamma\left(\frac{1+n}{2}\right) \psi\left(1+\frac{n}{2}\right)^2}{8 \Gamma\left(1+\frac{n}{2}\right)}- \\ \frac{\sqrt{\pi } \Gamma\left(\frac{1+n}{2}\right) \psi\left(1+\frac{n}{2}\right) \psi\left(\frac{1+n}{2}\right)}{4 \Gamma\left(1+\frac{n}{2}\right)}+ \frac{\sqrt{\pi } \Gamma\left(\frac{1+n}{2}\right) \psi\left(\frac{1+n}{2}\right)^2}{8 \Gamma\left(1+\frac{n}{2}\right)}- \\ \frac{\sqrt{\pi } \Gamma\left(\frac{1+n}{2}\right) \psi_1 \left(1+\frac{n}{2}\right)}{8 \Gamma \left(1+\frac{n}{2}\right)} + \frac{\sqrt{\pi } \Gamma\left(\frac{1+n}{2}\right)\psi_1\left(\frac{1+n}{2}\right)}{8 \Gamma\left(1+\frac{n}{2}\right)} \tag{2}$$

$\psi_1(z)$ is the PolyGamma Function. Put n=0.

$$I''(0) =\int_0^{\pi/2}\left( \log \sin x\right)^2 dx = \frac{1}{24}\left( \pi^3 +2\pi \log^2(2)\right)$$

Here, I have used

$\psi_1 \left( \frac{1}{2}\right)=\frac{\pi^2}{2}$

$\psi_1 \left( 1\right) = \frac{\pi^2}{6}$

$\psi \left( \frac{1}{2}\right) = -\gamma -2\ln(2)$

$\psi(1) = -\gamma$

and $\Gamma \left( \frac{1}{2}\right)=\sqrt{\pi}$

As I mentioned before, differentiating all the gamma and digamma can be tedious. Maybe Mr.Lord has a more elegant method in mind?

Last edited:

#### The Lord

##### New member
As I mentioned before, differentiating all the gamma and digamma can be tedious. Maybe Mr.Lord has a more elegant method in mind?
Great! This was my approach as well. #### DreamWeaver

##### Well-known member
Interesting problem...

The thing to do here is to consider the Beta function:

$$\displaystyle B(p,q)=2\int_0^{\pi/2}\sin^{2p-1}x\cos^{2q-1}\,dx\equiv \frac{2\Gamma(p)\Gamma(q)}{\Gamma(p+q)}$$

Now differentiate $$\displaystyle \frac{2\Gamma(p)\Gamma(q)}{\Gamma(p+q)}$$ twice w.r.t $$\displaystyle p$$, which will give an expression in terms of the Beta function, Digamma, and Trigamma functions. Then set $$\displaystyle q=p=1/2$$, since:

$$\displaystyle \frac{d^2}{dp^2} B(p,q)\, \Bigg|_{p=q=1/2}\equiv\int_0^{\pi/2}\log^2(\sin x)\,dx$$