# Definite integral $\int_0^{\pi} \sin^{n} x \ln(\sin x) dx$?

Is the integral $$I(n) = \int_0^{\pi} \sin^{n}(x) \ln(\sin(x)) dx$$ analytically tractable for $$n \in \mathbb{N}$$? If not, are there good upper and lower bounds?

To clarify, although this has a fairly standard-looking form, I haven't been able to find an answer anywhere and I've tried a few of the usual tricks (although I'm a tad rusty).

I have tried integration by parts to reduce to a simpler or recursive form but this seems to make the expression more complex, and likewise with the substitution $$u=\sin(x)$$.

Equally, it is relatively easy to see that the expression under the integral is non-positive. Taking a derivative $$\frac{d}{dx} \sin^{n}(x) \ln(\sin(x)) = \sin^{n-1}(x) \cos(x) (1 + n \ln(\sin(x))) = 0$$ gives a has minimum at $$-\frac{1}{en}$$.

Together these give the reasonably simple bounds: $$-\frac{\pi}{en} < I(n) < 0.$$

But numerically these don't appear to be particularly tight, so I'm still hopeful of an exact solution or an improvement.

• To the down-voter, I'm curious as to your problem with this post? I'm new to the site. Mar 17, 2021 at 18:38
• If you shift the origin by $\pi/2$ and expand $\ln(\sin x)$ in powers of trig functions, half the terms would cancel by the rule for odd function over even interval. I don't know how much help that is. Mar 17, 2021 at 19:06

Integrate by parts to obtain a recursive formula as follows

\begin{align} I_n&=\int_0^{\pi} \sin^{n}x \ln(\sin x) dx\\ &= -\int_0^{\pi} \sin^{n-1}x \ln(\sin x)\> d(\cos x)\>\\ & =\int_0^{\pi}((n-1) \sin^{n-2}x \cos^2x\ln(\sin x)+ \sin^{n-2}x\cos^2x)dx\\ &= (n-1) (I_{n-2}-I_n)+ \frac1{n-1}\int_0^{\pi}\sin^{n}x\>dx \end{align} Thus $$I_n = \frac{n-1}n I_{n-2} +\frac1{n(n-1)} \int_0^{\pi}\sin^{n}x\>dx$$ with $$I_0 = -\pi\ln2$$ and $$I_1= \ln2 -1$$. (See here for evaluating $$\int_0^{\pi/2}\sin^{n}x\>dx$$.)

As was hinted at in @Quanto's answer, we have the Wallis integral $$W(\alpha) := \int_0^{\pi/2} \sin^\alpha(x)\ dx = \frac{\sqrt \pi}{2} \frac{\Gamma\left(\frac{\alpha+1}{2}\right)}{\Gamma\left(\frac \alpha 2 + 1\right)},$$ for all $$\alpha \geqslant 0$$. Differentiating $$W$$ with respect to $$\alpha$$, we find (by the symmetry of the integrand) $$\frac{dW}{d\alpha} (\alpha) = \int_0^{\pi/2} \sin^{\alpha}(x) \log(\sin(x))\ dx = \frac 1 2 I(\alpha),$$ so that, setting $$g(\alpha) := \Gamma\left(\dfrac{\alpha+1}{2}\right)\Big/\Gamma\left(\dfrac \alpha 2 + 1\right)$$, $$\begin{split} \frac{1}{\sqrt{\pi}}I(\alpha) &= \frac{dg}{d\alpha} (\alpha) = \frac{d}{d\alpha}e^{\log g(\alpha)} = e^{\log g(\alpha)} \frac{d}{d\alpha}\log(g(\alpha)) \\ &=g(\alpha) \frac{d}{d\alpha}\left\{ \log \Gamma\left(\frac{\alpha+1}{2}\right) -\log\Gamma\left(\frac \alpha 2 + 1\right)\right\} \\ &= \frac 1 2\frac{\Gamma\left(\frac{\alpha+1}{2}\right)}{\Gamma\left(\frac \alpha 2 + 1\right)} \left\{\psi^{(0)}\left(\frac{\alpha+1}{2}\right) -\psi^{(0)}\left(\frac \alpha 2 + 1\right) \right\}, \end{split}$$ where $$\psi^{(0)}(z)=(\log \Gamma)'(z)$$ is the digamma function.

Bonus. We can go further. Using the identity $$\psi^{(0)}(t+1) = \psi^{(0)}(t) + 1/t$$ for all $$t>0$$, and taking advantage of the fact that $$\psi^{(0)}\left(\frac{s+1}{2s} \right) - \psi^{(0)}\left(\frac{1}{2s} \right) = \sum_{k=0}^\infty \frac{(-1)^k}{sk+1}$$ for $$s>0$$, choosing $$s = (\alpha+2)^{-1}$$ we find $$\frac{\alpha+2}{2}\left\{\psi^{(0)}\left(\frac{\alpha+1}{2}\right) -\psi^{(0)}\left(\frac \alpha 2 + 1\right) \right\} = - \frac{\alpha+2}{\alpha+1} + \sum_{k=0}^\infty \frac{(-1)^k}{k/(\alpha+2)+1},$$ whence $$\begin{split} I(\alpha) &= \sqrt\pi g(\alpha)\left\{-\frac1{\alpha+1} + \frac{1}{\alpha+2}\sum_{k=0}^\infty \frac{(-1)^k}{k/(\alpha+2)+1}\right\}\\ &=\sqrt\pi g(\alpha) \sum_{k=1}^\infty \frac{(-1)^k}{\alpha+k}. \end{split}$$ Now we restrict ourselves to nonnegative integers $$\alpha = n \geqslant 1$$, and we observe that $$\sum_{k=0}^\infty \frac{(-1)^k}{n+k} = \sum_{j=n}^\infty \frac{(-1)^{j-n}}{j} = (-1)^{n+1} \sum_{j=n}^\infty \frac{(-1)^{j+1}}{j} =(-1)^{n+1}\left[-\tilde H_{n} + \log(2) \right],$$ where $$\tilde H_{n} = \sum_{k=1}^{n} \frac{(-1)^{k+1}}{k}$$ is the $$n$$-th alternating harmonic number. we obtain $$\boxed{I(n) = (-1)^n\sqrt\pi \frac{\Gamma\left(\frac{n+1}{2}\right)}{\Gamma\left(\frac n 2 + 1\right)} \big( \tilde H_n - \log(2)\big).}$$ One may then distinguish even-$$n$$ and odd-$$n$$ cases and employ the duplication formula for $$\Gamma$$ to express $$I(n)$$ in terms of factorials and double factorials.

Mathematica says:

$$\fbox{\frac{\sqrt{\pi } \left(H_{\frac{n-1}{2}}-H_{\frac{n}{2}}\right) \Gamma \left(\frac{n+1}{2}\right)}{n \Gamma \left(\frac{n}{2}\right)}\text{ if }\Re(n)>-1}.$$

We have $$I_n=2\int_0^{\pi/2}\sin^n(x)\log(\sin(x)) dx= \int_0^{\pi/2}\sin^n(x)\log(1-\cos^2(x)) dx$$ $$=-\sum_{k\geq 1}\frac 1k\int_0^{\pi/2}\sin^n(x)\cos^{2k}(x) dx.$$

With the help of Euler's Beta function $$\frac{\Gamma(u)\Gamma(v)}{\Gamma(u+v)}=B(u,v)=2\int_0^{\pi/2}\sin^{2u-1}(x)\cos^{2v-1}(x) dx$$ we obtain $$I_n=-\Gamma(\frac {n+1}2)\sum_{k\geq 1}\frac 1{2k}\frac{\Gamma(k+\frac 12)}{\Gamma(\frac n2+k+1)}.$$ This can be further evaluated in closed terms by means of Harmonic Numbers of integer / half integer arguments, as in Igor Rivin's answer, but it may be already good for estimates.