$\displaystyle \int_0^{\pi/2}x^{n}\ln{(\sin x)}dx $
Does a closed form of the above integral exists?
$n$ is a positive integer
[Math] Closed form of: $\displaystyle \int_0^{\pi/2}x^{n}\ln{(\sin x)}dx $
calculusclosed-formdefinite integralsintegrationlogarithms
Related Solutions
Here is my solution:
Part 1
Let $$I(a)=\int_0^\infty\frac{\log(1+x^2 )}{\sqrt{(1+x^2 )(a^2+x^2 )}}dx\tag{1}$$ for $a>1$. Then rewrite the integral as $$ \begin{align*} I(a) &= \frac{1}{2}\int_1^\infty\frac{\log x}{\sqrt{x(x-1)(x+a^2-1)}}dx\quad x \mapsto \sqrt{x-1} \\ &= \frac{1}{2}\text{Re}\int_0^\infty\frac{\log x}{\sqrt{x(x-1)(x+a^2-1)}}dx \\ &= 2 \text{Re}\int_0^\infty \frac{\log x}{\sqrt{(x^2-1)(x^2+a^2-1)}}dx\quad x\mapsto x^2 \\ &\stackrel{\color{blue}{[1]}}{=} \text{Re} \left( -i K(a)\log\left(i\sqrt{a^2-1}\right)\right) \\ &= \text{Re} \left( K(a)\left( \frac{\pi}{2}-\frac{i}{2}\log(a^2-1)\right)\right) \end{align*} $$ where $K(k)$ denotes the complete elliptic integral of the first kind. Furthermore, it is known that $$K(k)=\frac{K\left(\frac{1}{k} \right)+iK'\left(\frac{1}{k} \right)}{k} \quad k>1$$ Thus, we obtain $$ \begin{align*} I(a)&= \text{Re} \left\{ \frac{K\left(\frac{1}{a} \right)+iK'\left(\frac{1}{a} \right)}{a}\left( \frac{\pi}{2}-\frac{i}{2}\log(a^2-1)\right)\right\} \\ &= \frac{\pi}{2a}K\left(\frac{1}{a} \right)+\frac{\log(a^2-1)}{2a}K'\left(\frac{1}{a}\right)\tag{2} \end{align*} $$
Part 2
Now, we turn our attention back to the original problem.
$$ \begin{align*} \int_0^\infty\frac{\log(x+4)}{\sqrt{x\,(x+3)\,(x+4)}}dx &=2 \int_0^\infty \frac{\log(4+x^2)}{\sqrt{(3+x^2)(4+x^2)}}dx \quad x\mapsto x^2 \\ &= 4\int_0^\infty \frac{\log(4+4x^2)}{\sqrt{(3+4x^2)(4+4x^2)}}dx \quad x\mapsto 2x \\ &= 2\int_0^\infty \frac{2\log(2)+\log(1+x^2)}{\sqrt{(4x^2+3 )(1+x^2)}}dx \tag{3} \end{align*} $$ The first integral is straightforward and it's value is $$\int_0^\infty \frac{1}{\sqrt{(4x^2+3)(1+x^2)}}dx\stackrel{\color{blue}{[2]}}{=} \frac{1}{2}K\left(\frac{1}{2} \right)$$ And the second integral can be evaluated as follows: $$ \begin{align*} &\; \int_0^\infty \frac{\log(1+x^2)}{\sqrt{(4x^2+3 )(1+x^2)}}dx \\ &= \int_0^\infty \frac{\log(1+x^2)-2\log(x)}{\sqrt{(4+3x^2 )(1+x^2)}}dx\quad x\mapsto 1/x \\ &\stackrel{\color{blue}{[1]}}{=}\frac{1}{\sqrt{3}}\int_0^\infty \frac{\log(1+x^2)}{\sqrt{\left(x^2+\frac{4}{3} \right)(1+x^2)}}dx+\frac{1}{2}\log\left(\frac{\sqrt{3}}{2} \right)K\left( \frac{1}{2}\right) \\ &= \frac{1}{\sqrt{3}}I\left(\frac{2}{\sqrt{3}} \right)+\frac{1}{2}\log\left(\frac{\sqrt{3}}{2} \right)K\left( \frac{1}{2}\right) \\ &\stackrel{\color{blue}{\text{eq }(2)}}{=} \frac{1}{\sqrt{3}}\left(\frac{\pi\sqrt{3}}{4}K\left(\frac{\sqrt{3}}{2}\right) -\frac{\log(3)\sqrt{3}}{4}K\left(\frac{1}{2}\right)\right)+\frac{1}{2}\log\left(\frac{\sqrt{3}}{2} \right)K\left( \frac{1}{2}\right) \\ &= \frac{\pi}{4}K\left(\frac{\sqrt{3}}{2}\right)-\frac{\log 2}{2}K\left(\frac{1}{2} \right) \end{align*} $$ Substituting everything in equation $(3)$, we get $$\int_0^\infty\frac{\log(x+4)}{\sqrt{x\,(x+3)\,(x+4)}}dx=K\left(\frac{\sqrt3}2\right)\frac\pi2+K\left(\frac12\right)\log(2)$$
Explanations
$\color{blue}{[1]}$ Refer to equation $(7.13)$ of this paper.
$\color{blue}{[2]}$ In general, we have $$\int_0^\infty \frac{1}{\sqrt{(1+x^2)(a^2+x^2)}}dx=\begin{cases}\displaystyle\frac{1}{a}K' \left(\frac{1}{a} \right)\quad \text{if }a>1 \\ K'(a) \quad \text{if } 0<a<1\end{cases}$$
The integral equals $\sqrt{2+\sqrt{8}} \cdot \Omega$, where $\Omega$ is the real half-period $\Omega = 1.3736768699491\ldots$ of the elliptic curve $$ E : y^2 = x^3 - 4 x^2 - 4 x, $$ i.e. the complete elliptic integral $$ \Omega = \int_{2-\sqrt{8}}^0 \frac{dx}{\sqrt{x^3-4x^2-4x}} = \int_{2+\sqrt{8}}^\infty \frac{dx}{\sqrt{x^3-4x^2-4x}} $$ (the integrand can also be brought to the classical form ${\bf K}(k) = \int_0^1 dz \, / \sqrt{(1-z^2) (1-k^2 z^2)}$, but with a more complicated $k$ and probably also an elementary factor more complicated than our $\sqrt{2+\sqrt{8}}$).
Here's gp code for this formula:
sqrt(2+sqrt(8)) * ellinit([0,-4,0,-4,0])[15]
The curve $E$ is reasonably nice, with conductor $128=2^7$ and $j$-invariant $10976 = 2^5 7^3 = 1728 + 2^5 17^2$; but $E$ does not have complex multiplication (CM), so we do not expect to get a simpler form as would be possible for a CM curve [e.g. $\int_1^\infty dx/\sqrt{x^3-1}$ is a Beta integral, and $\int_0^\infty dx/\sqrt{x^3+4x^2+2x} = \Gamma(1/8) \Gamma(3/8) / (4\sqrt{\pi})$].
Harry Peter already used the trigonometric substitution $$ (\cos \phi, \sin \phi, d\phi) = \left( \frac{1-t^2}{1+t^2}, \frac{2t}{1+t^2}, \frac{2 \, dt}{1+t^2} \right) $$ (which I guess is the "Weierstrass substitution" suggested in the comment of Steven Stadnicki) to write $I$ as $$ \int_0^1 \frac{(1+t)dt}{\sqrt{(1+2t-t^2) (t-t^3)}}, $$ which is a half-period of the holomorphic differential $(1+t) dt/u$ on the hyperelliptic curve $C: u^2 = (1+2t-t^2) (t-t^3)$ of genus $2$. Most such periods cannot be simplified further, but this one is special because the curve has more symmetry than just the "hyperelliptic involution" $(t,u) \leftrightarrow (t,-u)$. In particular $C$ has an involution $$ \iota: (t,u) \leftrightarrow \left( \frac{1-t}{1+t}, \frac{2^{3/2}}{(1+t)^3} u \right) $$ which also sends the interval $(0,1)$ to itself, reversing the orientation. This suggests splitting the integral at the midpoint $t_0 := \sqrt{2} - 1$ and applying the change of variable $(t,dt) \leftarrow ((1-t)/(1+t), -2\,dt/(1+t)^2)$ to the integral over $(t_0,1)$ to obtain $\sqrt{2} \int_0^{t_0} dt/u$. Hence $$ I = \int_0^{t_0} \frac{(\sqrt{2}+1+t)dt}{\sqrt{(1+2t-t^2) (t-t^3)}} $$ and now the change of variable $X = t + (1-t)/(1+t)$ transforms $I$ to an elliptic integral corresponding to the quotient curve $C\,/\langle\iota\rangle$. While $C\,/\langle\iota\rangle$ has irrational coefficients involving $\sqrt{2}$, it has rational $j$-invariant, so we can find coordinates that identify $C\,/\langle\iota\rangle$ with our curve $E$ with rational coefficients, though at the cost of introducing the factor $\sqrt{2+\sqrt{8}}$ into the formula for $I$ given at the start of this answer.
Best Answer
Using integration by parts the problem boils down to finding a closed form for: $$ I_n = \int_{0}^{\pi/2} x^n\cot(x)\,dx. \tag{1}$$ By considering the logarithmic derivative of the Weierstrass product for the sine function we have: $$ \cot(x) = \frac{1}{x}+\sum_{n\geq 1}\frac{2x}{x^2-\pi^2 n^2}=\frac{1}{x}+\sum_{n\geq 1}\left(\frac{1}{x-n\pi}+\frac{1}{x+n\pi}\right) \tag{2}$$ and: $$ \frac{1-\pi x\cot(\pi x)}{2}=\sum_{n\geq 1}\zeta(2n)\,x^{2n}\tag{3} $$ hence: $$ I_n = \pi^{n}\int_{0}^{1/2}x^{n-1}\cdot \pi x\cot(\pi x)\,dx =\pi^n\left(\frac{1}{n 2^n}-2\sum_{n\geq 1}\frac{\zeta(2n)}{3n 8^n}\right).\tag{4}$$ On the other hand, by setting $z=e^{ix}$ in $(1)$ we may see that $I_n$ is given by a countour integral: $$ I_n = \int_{C} (-i\log(z))^n \frac{z^2+1}{z^3-z}\,dz \tag{5}$$ or simply by: $$ I_n = \int_{0}^{+\infty}\left(\frac{\pi}{2}-\arctan(u)\right)^n \frac{u}{1+u^2}\,dx = \int_{0}^{+\infty}\frac{\left(\arctan u\right)^n}{u(1+u^2)}\,du\tag{6}$$ so if we apply partial fraction decomposition and integration by parts again, we may see that $I_n$ is given by a finite combination of $\pi^n \log(2)$ and values of the zeta function at the odd integers multiplied by powers of $\pi$.