Welcome to mathimatikoi.org forum; Enjoy your visit here.

## $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

Calculus (Integrals, Series)
Grigorios Kostakos
Founder
Articles: 0
Posts: 460
Joined: Mon Nov 09, 2015 1:36 am
Location: Ioannina, Greece

### $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

Evaluate the integral:

$$\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$$
Grigorios Kostakos
Tolaso J Kos
Articles: 2
Posts: 855
Joined: Sat Nov 07, 2015 6:12 pm
Location: Larisa
Contact:

### Re: $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

I just give a brief solution using $\rm{B}, \Gamma$ functions. Thus we have:

$$\int_{0}^{\pi/2}\ln^2\left ( \sin x \right )\, dx\overset{u=\sin x}{=\! =\! =\! =\!}\int_{0}^{1}\frac{\ln^2 u}{\sqrt{1-u^2}}\,du$$

Now consider the integral:

$$\int_{0}^{1}\frac{u^{m-1}}{\sqrt{1-u^2}}du=\frac{1}{2}{\rm B}\left ( \frac{1}{2}, \frac{m}{2} \right )=\frac{1}{2}\frac{\Gamma \left ( \frac{1}{2} \right )\Gamma \left ( \frac{m}{2} \right )}{\Gamma \left ( \frac{m+1}{2} \right )}=\frac{1}{2}\frac{\sqrt{\pi}\,\Gamma \left ( \frac{m}{2} \right )}{\Gamma \left ( \frac{m+1}{2} \right )}$$

We differentiate with respect to $m$ twice and then we let $m=1$ and get to the desired result which is:

$$\int_{0}^{\pi/2 }\ln^2\left ( \sin x \right )dx=\frac{\pi^3}{24}+\frac{\pi}{2}\ln^2 2$$

I'll be glad to see someone type the whole solution.
Imagination is much more important than knowledge.
Grigorios Kostakos
Founder
Articles: 0
Posts: 460
Joined: Mon Nov 09, 2015 1:36 am
Location: Ioannina, Greece

### Re: $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

We supplement the above solution:

\begin{align*} I(m)&=\int_{0}^{1}{\frac{u^{m-1}}{\sqrt{1-u^2}}\,du}=\frac{\sqrt{\pi}}{2}\frac{\Gamma\bigl({\tfrac{m}{2}}\bigr)}{\Gamma\bigl({\tfrac{m+1}{2}}\bigr)}\quad\Rightarrow\\ \frac{d^2}{dm^2}I(m)&=\int_{0}^{1}{\frac{u^{m-1}\log^2{u}}{\sqrt{1-u^2}}\,du}\\ &=\frac{\sqrt{\pi}}{8}\frac{\Gamma\bigl({\tfrac{m}{2}}\bigr)}{\Gamma\bigl({\tfrac{m+1}{2}}\bigr)}\Bigl({\psi'\bigl({\tfrac{m}{2}}\bigr)-\psi'\bigl({\tfrac{m+1}{2}}\bigr)+\Bigr({\psi\bigl({\tfrac{m}{2}}\bigr)-\psi\bigl({\tfrac{m+1}{2}}\bigr)}\Bigr)^2}\Bigr)\quad\Rightarrow\\ \int_{0}^{1}{\frac{\log^2{u}}{\sqrt{1-u^2}}\,du}&=\frac{\sqrt{\pi}}{8}\frac{\Gamma\bigl({\tfrac{1}{2}}\bigr)}{\Gamma(1)}\Bigl({\psi'\bigl({\tfrac{1}{2}}\bigr)-\psi'(1)+\Bigr({\psi\bigl({\tfrac{1}{2}}\bigr)-\psi(1)}\Bigr)^2}\Bigr)\\ &=\frac{\sqrt{\pi}}{8}\frac{\sqrt{\pi}}{1}\Bigl({\frac{\pi^2}{2}-\frac{\pi^2}{6}+({-2\log2-\gamma+\gamma})^2}\Bigr)\\ &=\frac{\pi}{2}\log^2{2}+\frac{\pi^3}{24}\,, \end{align*}

where $\psi$ is the digamma function and $\gamma$ is the Euler-Mascheroni constant.
Grigorios Kostakos
Grigorios Kostakos
Founder
Articles: 0
Posts: 460
Joined: Mon Nov 09, 2015 1:36 am
Location: Ioannina, Greece

### Re: $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

We give a solution which can be found in J. Edwards, A treatise on the integral calculus vol. II :

We use that $\displaystyle \int_{0}^{\frac{\pi}{2}}{\log^2(\tan{x})\,dx}=\frac{\pi^3}{8}\quad(1)\,,$ which is proven here

Let \begin{align*}
I&=\displaystyle \int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}\stackrel{(*)}{=}\int_{0}^{\frac{\pi}{2}}{\log^2(\cos{x})\,dx}\,,\\
J&=\displaystyle \int_{0}^{\frac{\pi}{2}}{\log(\sin{x})\,\log(\cos{x})\,dx}\,.
\end{align*} Then \begin{align*}
2I+2J&=\int_{0}^{\frac{\pi}{2}}{\bigl({\log(\sin{x})+\log(\cos{x})}\bigr)^2\,dx}\\
&=\int_{0}^{\frac{\pi}{2}}{\log^2\bigl({\tfrac{1}{2}\sin({2x})}\bigr)\,dx}\\
&=\int_{0}^{\frac{\pi}{2}}{\bigl({\log(\sin({2x}))-\log2}\bigr)^2\,dx}\\
&=\int_{0}^{\frac{\pi}{2}}{\log^2(\sin({2x}))\,dx}-2\log2\int_{0}^{\frac{\pi}{2}}{\log(\sin({2x}))\,dx}+\int_{0}^{\frac{\pi}{2}}{\log^2{2}\,dx}\\
&\mathop{=\!=\!=\!=\!=\!=}\limits^{\begin{subarray}{c}
{t\,=\,2x}\\
{\frac{1}{2}\,dt\,=\,dx}\\
\end{subarray}}\,\frac{1}{2}\int_{0}^{\pi}{\log^2(\sin{t})\,dt}-\log2\int_{0}^{\pi}{\log(\sin{t})\,dt}+\frac{\pi}{2}\log^2{2}\\
&=\frac{1}{2}\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{t})\,dt}+\frac{1}{2}\int_{\frac{\pi}{2}}^{\pi}{\log^2(\sin{t})\,dt}\,-\\
&\mathop{=\!=\!=\!=\!=\!=}\limits^{\begin{subarray}{c}
{t\,=\,u-\frac{\pi}{2}}\\
{dt\,=\,du}\\
\end{subarray}}\,\frac{1}{2}I+\frac{1}{2}\int_{0}^{\frac{\pi}{2}}{\log^2(\cos{u})\,du}\,- \\
&\stackrel{(*)}{=}\frac{1}{2}I+\frac{1}{2}I-2\log2\int_{0}^{\frac{\pi}{2}}{\log(\sin{t})\,dt}+\frac{\pi}{2}\log^2{2}\\
&\stackrel{(**)}{=\!=}I-2\log2\Bigl({-\frac{\pi}{2}\log{2}}\Bigr)+\frac{\pi}{2}\log^2{2}\\
\end{align*} and \begin{align*}
2I-2J&=\int_{0}^{\frac{\pi}{2}}{\bigl({\log(\sin{x})-\log(\cos{x})}\bigr)^2\,dx}\\
&=\int_{0}^{\frac{\pi}{2}}{\log^2(\tan{x})\,dx}\\
\end{align*} Adding $(2)$ and $(3)$, we have \begin{align*}
I&=\frac{\pi}{2}\log^2{2}+\frac{\pi^3}{24}\,.
\end{align*} Now from $(2)$ we have the extra result $J=\frac{\pi}{2}\log^2{2}-\frac{\pi^3}{48}\,.$

$(*)\quad I=\displaystyle \int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}\mathop{=\!=\!=\!=\!=\!=}\limits^{\begin{subarray}{c} {x\,=\,\frac{\pi}{2}}-t\\ {dx\,=\,-dt}\\ \end{subarray}}\,-\int_{\frac{\pi}{2}}^{0}{\log^2(\cos{t})\,dt}=\int_{0}^{\frac{\pi}{2}}{\log^2(\cos{t})\,dt}\,.$

$(**)\quad\displaystyle \int_{0}^{\frac{\pi}{2}}{\log(\sin{t})\,dt}=-\frac{\pi}{2}\log2\,,$ left as an exercise.
Grigorios Kostakos
Tolaso J Kos
Articles: 2
Posts: 855
Joined: Sat Nov 07, 2015 6:12 pm
Location: Larisa
Contact:

### Re: $\int_{0}^{\frac{\pi}{2}}{\log^2(\sin{x})\,dx}$

Yet another solution using complex analysis.

The idea is to integrate the principal branch of $f(z) := \log^2{(1 - e^{2iz})} = \log^2{(-2ie^{iz}\sin{z})}$ over the contour below, and then let $R \to \infty$ and $\epsilon \to 0$.
XhNrU.png (11.01 KiB) Viewed 1411 times
[/centre]

First of all, $1 - e^{2iz} \leq 0$ only when $z = k\pi + iy$, where $k$ is integral and $y \leq 0$. Thus, in the region of the plane which is obtained by omitting the lines $\{k\pi + iy: y\leq 0\}$ for $k \in \mathbb Z$, the principal branch of $\log{(1-e^{2iz})}$ is defined and analytic. Note that, for each fixed $R$ and $\epsilon$, the contour we wish to integrate over is contained entirely within this region.

By Cauchy's theorem, the integral over the contour vanishes for each fixed $R$. Since $f(x + iR) = \log^2{(1 - e^{2ix}e^{-2R})} \to 0$ uniformly as $R \to \infty$, the integral over the segment $[iR,\pi/2 + iR]$ vanishes in the limit. Similarly, since $1 - e^{2iz} = O(z)$ as $z \to 0$, we have $f(z) = O(\log^2{|z|})$ for small enough $z$, which, since $\epsilon \log^2{\epsilon} \to 0$ with $\epsilon$, means that the the integral over the circular arc from $i\epsilon$ to $\epsilon$ vanishes as $\epsilon \to 0$.

From the vertical sides of the contour, we get the contribution
\begin{align*} \int_{[\pi/2,\pi/2 + iR]} + \int_{[iR,i\epsilon]} f(z)\,dz & = i\int_0^R f(\pi/2 + iy)\,dy -i\int_\epsilon^R f(iy)\,dy. \end{align*}
Since $f(iy)$ and $f(\pi/2 + iy)$ are real, this contribution is purely imaginary.

Finally, the contribution from the bottom side of the contour, after letting $\epsilon \to 0$, is
\begin{align*} \int_0^{\pi/2} f(x)\,dx = \int_0^{\pi/2} \log^2{(-2ie^{ix}\sin{x})}\,dx, \end{align*}
and we know from the preceding remarks that the real part of this integral must vanish. For $x$ between $0$ and $\pi/2$, the quantity $2\sin{x}$ is positive. Writing $-ie^{ix} = e^{i(x - \pi/2)}$, we see that $x - \pi/2$ is the unique value of $\arg{(-2ie^{ix}\sin{x})}$ which lies in $(-\pi,\pi)$. Since we have chosen the principal branch of $\log{z}$, it follows from these considerations that $\log{(-2ie^{ix}\sin{x})} = \log{(2\sin{x})} + i(x-\pi/2)$, and therefore that
\begin{align*} \text{Re}{f(x)} &= \log^2{(2\sin{x})} - (x-\pi/2)^2 \\ &= \log^2{(\sin{x})} + 2\log{2}\log{(\sin{x})} + \log^2{2} - (x - \pi/2)^2. \end{align*}
By setting $\int_0^{\pi/2} \text{Re}f(x)\,dx = 0$ we get
\begin{align*} \int_0^{\pi/2} \log^2{(\sin{x})}\,dx &= \int_0^{\pi/2}(x-\pi/2)^2\,dx - 2\log{2}\int_0^{\pi/2} \log{(\sin{x})}\,dx -\frac{\pi}{2}\log^2{2} \\ & = \frac{\pi^3}{24}+ \frac{\pi}{2} \log^2{2} \end{align*}
as expected
Imagination is much more important than knowledge.