# Evaluate $\int_0^{\pi/2}\frac{x^2\log^2{(\sin{x})}}{\sin^2x}dx$

How evaluate this integral? $$I=\int_0^{\pi/2}\frac{x^2\log^2{(\sin{x})}}{\sin^2x}\,dx$$ Note: $$\int_0^{\pi/2}\frac{x^2\log{(\sin x)}}{\sin^2x}dx=\pi\ln{2}-\frac{\pi}{2}\ln^22-\frac{\pi^3}{12}.$$

• It would be useful to see how you derived the last identity. Fourier series, differentiation under the integral sign or what else? – Jack D'Aurizio Feb 10 '15 at 22:10
• $$u=log{\,x}, du=cot{\,x}; v=\int\frac{x^2}{sin^2x}=\operatorname{CI_2}{(2x)}+2x\log({2sin{\,x})}-x^2cot{\,x}$$ – user178256 Feb 10 '15 at 23:19
• sorry,$$u=log{sinx}$$ – user178256 Feb 10 '15 at 23:21
• Do you know how to find the integral $\int_0^{\pi/2}\frac{x^2\log{(\sin x)}}{\sin^2x}dx=\pi\ln{2}-\frac{\pi}{2}\ln^22-\frac{\pi^3}{12}.$ – science Feb 11 '15 at 18:39
• Below I have just computed the Fourier series of $\log\sin x,\log^2\sin x$ and $\frac{x^2}{\sin^2 x}$. – Jack D'Aurizio Feb 11 '15 at 19:06

$$I=\frac\pi3\ln^32-\pi\ln^22+2\pi\ln2+\frac{\pi^3}6\left(\ln2-1\right)+\frac\pi8\zeta(3)$$

• Answers such as this add no value to the site - simply stating a number out of thin air is not 'mathematics'. – Carl Mummert Feb 19 '15 at 19:57
• I agree with Carl - What good does stroking your ego do in terms of teaching people how to solve these problems? Also, this doesn't even answer the question: "How [do I] evaluate this integral?" – user142198 Feb 20 '15 at 12:00
• @CarlMummert, I would say these answers are good indeed. For someone who worked out to check their solution. – Ama Feb 23 '15 at 17:30
• @CarlMummert: Cleo's profile says, "I have a medical condition that makes it very difficult for me to engage in conversations, or post long answers, sorry for that." So I doubt Cleo's brevity is because she wants to "stroke her ego" or anything like that. Let's be a little compassionate here and be thankful for these rapid computations, which allow people to check their answers quickly. – Marcus Emilsson Mar 12 '15 at 10:48
• Such a condition seems to me to be incompatible with participating on a site whose main purpose is to post "long" answers (i.e. answers that explain something, as is the standard in mathematics). We can wish Cleo all the best with some other site. @Elizabeth Lin – Carl Mummert Mar 12 '15 at 23:54

Let's start out with the auxiliary result \begin{equation*} \int_0^{\pi/2}\frac{x^2\log{(\sin(x))}}{\sin^2(x)}dx=\pi\ln{(2)}-\frac{\pi}{2}\ln^2(2)-\frac{\pi^3}{12}. \end{equation*}

By the integration by parts all reduces to $$\int_0^{\pi/2} \cot(x) (x^2 \cot(x)+2 x\log(\sin(x))) \ dx=\int_0^{\pi/2} x^2 \cot^2(x) \ dx+2\int_0^{\pi/2} x\cot(x) \log(\sin(x))) \ dx.$$ For the first integral in the right-hand side we apply the integration by parts that yields \begin{equation*} \begin{aligned} \int_0^{\pi/2} x^2 \cot^2(x) \ dx &=-\frac{\pi^3}{8}+\int_0^{\pi/2} 2 x (x+\cot (x)) \ dx \\ &=-\frac{\pi^3}{24}+2\int_0^{\pi/2}x \cot (x) \ dx \\ &=-\frac{\pi^3}{24}-2\int_0^{\pi/2} \log(\sin(x)) \ dx \\ &=-\frac{\pi^3}{24}-\int_0^{\pi} \log(\sin(x)) \ dx \\ \end{aligned} \end{equation*} where in the penultimate equality we used again the integration by parts, and then the symmetry.

Then, \begin{equation*} \begin{aligned} \int_0^{\pi} \log(\sin(x)) \ dx &=\int_0^{\pi} \log(2\sin(x/2)\cos(x/2)) \ dx \\ &=\pi \log(2)+ \int_0^{\pi} \log(\sin(x/2)) \ dx+ \int_0^{\pi} \log(\cos(x/2)) \ dx. \end{aligned} \end{equation*} Letting $x/2=y$ in both integrals in the right-hand side, we obtain that \begin{equation*} \begin{aligned} \int_0^{\pi} \log(\sin(x)) \ dx &=\pi \log(2) + 2\int_0^{\pi/2} \log(\sin(x)) \ dx+2\int_0^{\pi/2} \log(\cos(x)) \ dx \\ &=\pi \log(2) + 4\int_0^{\pi/2} \log(\sin(x)) \ dx \\ &=\pi \log(2) + 2\int_0^{\pi} \log(\sin(x)) \ dx \\ \end{aligned} \end{equation*} whence we get that
$$\int_0^{\pi} \log(\sin(x)) \ dx =-\pi\log(2).$$ Then, $$\int_0^{\pi/2} x^2 \cot^2(x) \ dx=\pi\log(2)-\frac{\pi^3}{24}.$$

On the other hand, the integration by parts yields that \begin{equation*} \begin{aligned} 2\int_0^{\pi/2}x\cot(x) \log(\sin(x)) \ dx &=-2\int_0^{\pi/2} (\log ^2(\sin (x))+ x \cot (x) \log (\sin (x))) \ dx \\ &=-2\int_0^{\pi/2} \log ^2(\sin (x)) \ dx -2\int_0^{\pi/2} x \cot (x) \log (\sin (x)) \ dx \end{aligned} \end{equation*}

whence we have that $$\int_0^{\pi/2}x\cot(x) \log(\sin(x)) \ dx=-\frac{1}{2}\int_0^{\pi/2} \log ^2(\sin (x)) \ dx.$$ According to the trigonometric form of the beta function, we have that $$\int_0^{\pi/2} \sin^a(x)\cos^b(x) \ dx=\frac{1}{2}B \left(\frac{1}{2}(a+1),\frac{1}{2}(b+1)\right).$$ Differentiating $2$ times with respect to $a$ and then letting $a\to 0$ and $b\to 0$, we obtain that \begin{equation*} \begin{aligned} \int_0^{\pi/2} \log ^2(\sin (x)) \ dx &=\frac{1}{2} \lim_{b \to 0} \lim_{a \to 0} \frac{\partial^2}{\partial a^2}\left(B \left(\frac{1}{2}(a+1),\frac{1}{2}(b+1)\right)\right) \\ &=\frac{1}{24} \left(\pi ^3+12 \pi \log ^2(2)\right). \end{aligned} \end{equation*}

Thus, $$\int_0^{\pi/2}x\cot(x) \log(\sin(x)) \ dx=-\frac{1}{48} \left(\pi ^3+12 \pi \log ^2(2)\right).$$

and finally our auxiliary result is proved. $$\int_0^{\pi/2}\frac{x^2\log{(\sin(x))}}{\sin^2(x)}dx=\pi\ln{(2)}-\frac{\pi}{2}\ln^2(2)-\frac{\pi^3}{12}.$$

Now, we prove the main result,

\begin{equation*} \int_0^{\pi/2}\frac{x^2\log^2{(\sin(x))}}{\sin^2(x)}dx=\left(\frac{\pi ^3 }{6} +2 \pi \right) \log (2)+\frac{1}{3} \pi \log ^3(2)+\frac{1}{8}\pi \zeta (3)-\frac{\pi ^3}{6}-\pi \log ^2(2). \end{equation*}

Applying the integration by parts, we get $$2\int_0^{\pi/2} x^2 \cot ^2(x) \log (\sin (x)) \ dx+2 \int_0^{\pi/2} x \cot (x) \log ^2(\sin (x)) \ dx$$ For the integral in the left side we make use of the integration by parts that yields $$2\int_0^{\pi/2} x^2 \cot ^2(x) \log (\sin (x)) \ dx$$ $$=2 \int_0^{\pi/2} x^3 \cot (x) \ dx + 2 \int_0^{\pi/2} x^2 \cot ^2(x) \ dx + 4\int_0^{\pi/2} x^2 \log (\sin (x)) \ dx+4 \int_0^{\pi/2} x \cot (x) \log (\sin (x)) \ dx$$ $$=\frac{2}{3} \int_0^{\pi/2} x^3 \cot (x) \ dx + 2 \int_0^{\pi/2} x^2 \cot ^2(x) \ dx +4 \int_0^{\pi/2} x \cot (x) \log (\sin (x)) \ dx$$ and since the last $2$ integrals are already compute (see the auxiliary result), we obtain $$\frac{2}{3} \int_0^{\pi/2} x^3 \cot (x) \ dx + 2 \int_0^{\pi/2} x^2 \cot ^2(x) \ dx +4 \int_0^{\pi/2} x \cot (x) \log (\sin (x)) \ dx$$ $$=\frac{2}{3} \int_0^{\pi/2} x^3 \cot (x) \ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}$$ and integrating by parts again, we get $$-2\int_0^{\pi/2} x^2 \log(\sin(x)) \ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}.$$

Using that $\displaystyle \log(\sin(x))=-\log(2)-\sum_{n=1}^{\infty} \frac{\cos(2 n x)}{n}$, we obtain
$$-2\int_0^{\pi/2} x^2\left(-\log(2)-\sum_{n=1}^{\infty} \frac{\cos(2 n x)}{n}\right)\ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}$$ $$=2\log(2)\int_0^{\pi/2} x^2\ dx+2\int_0^{\pi/2} x^2 \sum_{n=1}^{\infty} \frac{\cos(2 n x)}{n} \ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}$$ $$=2\int_0^{\pi/2} x^2 \sum_{n=1}^{\infty} \frac{\cos(2 n x)}{n} \ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}+\frac{1}{12} \pi ^3 \log (2)$$ $$=2 \sum_{n=1}^{\infty} \int_0^{\pi/2} x^2 \frac{\cos(2 n x)}{n} \ dx+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}+\frac{1}{12} \pi ^3 \log (2)$$ $$=-\frac{3}{8} \pi \zeta(3)+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}+\frac{1}{12} \pi ^3 \log (2).$$

Therefore, we have that $$2\int_0^{\pi/2} x^2 \cot ^2(x) \log (\sin (x)) \ dx=-\frac{3}{8} \pi \zeta(3)+2\pi\log(2)-\pi\log^2(2)-\frac{\pi^3}{6}+\frac{1}{12} \pi ^3 \log (2).$$

For the remaining integral, we use the integration by parts again that yields $$2 \int_0^{\pi/2} x \cot (x) \log ^2(\sin (x)) \ dx=-2\int_0^{\pi/2} \log ^3(\sin (x)) \ dx-4 \int_0^{\pi/2} x \cot (x) \log ^2(\sin (x)) \ dx$$ and thus $$2 \int_0^{\pi/2} x \cot (x) \log ^2(\sin (x)) \ dx=-\frac{2}{3}\int_0^{\pi/2} \log ^3(\sin (x)) \ dx.$$

According to the trigonometric form of the beta function, we know that $$\int_0^{\pi/2} \sin^a(x)\cos^b(x) \ dx=\frac{1}{2}B \left(\frac{1}{2}(a+1),\frac{1}{2}(b+1)\right).$$ Differentiating $3$ times with respect to $a$ and then letting $a\to 0$ and $b\to 0$, we obtain that \begin{equation*} \begin{aligned} \int_0^{\pi/2} \log ^3(\sin (x)) \ dx &=\frac{1}{2} \lim_{b \to 0} \lim_{a \to 0} \frac{\partial^3}{\partial a^3}\left(B \left(\frac{1}{2}(a+1),\frac{1}{2}(b+1)\right)\right) \\ &=-\frac{3 \pi }{4}\zeta (3)-\frac{1}{2} \pi \log ^3(2)-\frac{1}{8} \pi ^3 \log (2). \end{aligned} \end{equation*}

Thus, $$2 \int_0^{\pi/2} x \cot (x) \log ^2(\sin (x)) \ dx=\frac{1}{2}\pi \zeta (3)+\frac{1}{3} \pi \log ^3(2)+\frac{1}{12} \pi ^3 \log (2).$$

Hence, $$\int_0^{\pi/2}\frac{x^2\log^2{(\sin(x))}}{\sin^2(x)}dx=\left(\frac{\pi ^3 }{6} +2 \pi \right) \log (2)+\frac{1}{3} \pi \log ^3(2)+\frac{1}{8}\pi \zeta (3)-\frac{\pi ^3}{6}-\pi \log ^2(2).$$

Q.E.D.

• This question is about to be deleted (see discussion here). – user1729 Aug 31 '18 at 15:18

Since $$\log(2\sin x)=-\sum_{k\geq 1}\frac{\cos(2kx)}{k}\tag{1}$$ it follows that: $$\log^2(2\sin x)=\sum_{j,k\geq 1}\frac{\cos(2kx)\cos(2jx)}{kj}=\frac{1}{2}\sum_{j,k\geq 1}\frac{\cos(2(k+j)x)+\cos(2(k-j)x)}{kj}$$ where: $$\sum_{j,k\geq 1}\frac{\cos(2(k+j)x)}{kj}=\sum_{n\geq 2}\cos(2nx)\sum_{h=1}^{n-1}\frac{1}{h(n-h)}=\sum_{n\geq 2}\frac{2 H_{n-1}}{n}\cos(2nx),$$ $$\sum_{k\geq j\geq 1}\frac{\cos(2(k-j)x)}{kj}=\sum_{n\geq 0}\cos(2nx)\sum_{j=1}^{+\infty}\frac{1}{j(n+j)}=\zeta(2)+\sum_{n\geq 1}\frac{H_n}{n}\cos(2nx),$$ so: $$\log^2(2\sin x) = \frac{\pi^2}{3}+\sum_{n\geq 1}\frac{H_{n-1}+H_n}{n}\,\cos(2nx)\tag{2}$$ and we just need to find: $$J_n = \frac{4}{\pi}\int_{0}^{\pi/2}\frac{x^2}{\sin^2 x}\cos(2nx)\,dx \tag{3}$$ to turn the computation of the integral into a computation of a series. Now:

$$J_n = -\frac{16}{\pi}\cdot\Re\int_{0}^{\pi/2}\frac{x^2 e^{2nix}}{(e^{ix}-e^{-ix})^2}\,dx\tag{4}$$ and since: $$\frac{x^2 e^{2(n-1)ix}}{(1-e^{-2ix})^2}=x^2 e^{2(n-1)ix}\left(1+2e^{-2ix}+3e^{-4ix}+4e^{-6ix}+\ldots\right),$$ $$\Re\int_{0}^{\pi/2}x^2 e^{2mix}\,dx = (-1)^m\frac{\pi}{m^2},$$ it follows that: $$\begin{eqnarray*} J_n &=&4\log 2-n\frac{\pi^2}{3}-4\sum_{k=1}^{n-1}(n-k)\frac{(-1)^k}{k^2}\\&=&4n\sum_{k\geq n}\frac{(-1)^k}{k^2}-4\sum_{k\geq n}\frac{(-1)^k}{k}\tag{5}\end{eqnarray*}$$ The plan, now, is to exploit partial summation through the identities: $$\sum_{k=1}^{n}\frac{H_{k-1}}{k}=\frac{1}{2}\left(H_n^2-H_n^{(2)}\right), \qquad \sum_{k=1}^{n}\frac{H_{k}}{k}=\frac{1}{2}\left(H_n^2+H_n^{(2)}\right),$$ $$\sum_{k=1}^{n}H_k = n H_n - \sum_{k=1}^{n-1}\frac{k}{k+1} = n H_n -n + H_n.$$ Continues.