# Generalised Integral $I_n=\int_0^{\pi/2} \frac{x^n}{\sin ^n x} \ \mathrm{d}x, \quad n\in \mathbb{Z}^+.$

I have this integral, $$I_n=\displaystyle \int_0^{\pi/2} \frac{x^n}{\sin ^n x} \ \mathrm{d}x, \qquad n\in \mathbb{Z}^+.$$ We have the results \begin{align} I_1 & = 2C, \\ I_2 &= \pi\log 2, \\ I_4 & = -\frac{\pi^3}{12} + 2\pi\log 2 + \frac{\pi^3}{3}\log 2-\frac{3\pi}{2}\zeta(3), \end{align} where $C$ is Catalan's constant. Can we prove any of these results, or make any progress on $I_3$, or the general case?

• I think your best chance is a recurrence relationship of $I(n)$ in terms of $I(n-2)$ and/or $I(n-1)$. May 8, 2014 at 13:12
• $\displaystyle{\large I_{4}}$ must be $\displaystyle{\large\color{#c00000}{-\,{\pi^{3} \over 12}} + 2\pi\ln\left(2\right) + {\pi^{3} \over 3}\,\ln\left(2\right) - {3\pi \over 2}\,\zeta\left(3\right)}$. Jul 28, 2014 at 2:55
• I have changed the formatting of the title so as to make it take up less vertical space -- this is a policy to ensure that the scarce space on the main page is distributed evenly over the questions. See here for more information. Please take this into consideration for future questions. Thanks in advance. Mar 12, 2018 at 16:59

Integrating by parts 3 times,

\begin{align} \int_{0}^{\pi /2} \frac{x^{4}}{\sin^{4} x} \ dx &= - \frac{x^{4}}{3} \cot(x) \left(\csc^{2} (x) +2 \right) \Bigg|^{\pi/2}_{0} + \frac{4}{3} \int_{0}^{\pi /2} x^{3} \cot (x) \left(\csc^{2} (x) +2 \right) \ dx \\ &= \frac{4}{3} \int_{0}^{\pi /2} x^{3} \cot (x) \left(\csc^{2} (x) +2 \right) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx + \frac{4}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \csc^{2}(x) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx - \frac{2}{3}x^{3} \cot^{2}(x) \Bigg|^{\pi/2}_{0} + 2 \int_{0}^{\pi /2} x^{2} \cot^{2}(x) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx + 2 \int_{0}^{\pi /2} x^{2} \cot^{2} (x) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx -2x^{2} \Big( x + \cot(x) \Big) \Bigg|^{\pi/2}_{0} +4 \int_{0}^{\pi /2} x\Big(x+ \cot(x) \Big) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx - \frac{\pi^{3}}{4} + 4 \int_{0}^{\pi /2} x^{2} \ dx + 4 \int_{0}^{\pi /2} x \cot(x) \ dx \\ &= \frac{8}{3} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx - \frac{\pi^{3}}{12} + 4 \int_{0}^{\pi /2} x \cot(x) \ dx . \end{align}

In general, $$\int_{a}^{b} f(x) \cot(x) \ dx = 2 \sum_{n=1}^{\infty} \int_{a}^{b} f(x) \sin (2nx) \ dx .$$

See here.

So \begin{align} \int_{0}^{\pi /2} x^{3} \cot(x) \ dx &= 2 \sum_{n=1}^{\infty} \int_{0}^{\pi /2} x^{3} \sin (2nx) \ dx \\ &= 2 \sum_{n=1}^{\infty} \left(\frac{(-1)^{n-1} \pi^{3}}{16n} - \frac{(-1)^{n-1} 3\pi}{8n^{3}} \right) \\ &= \frac{\pi^{3}}{8} \ln (2) - \frac{3 \pi}{4} \eta(3) \\ &= \frac{\pi^{3}}{8} \ln (2) - \frac{9 \pi }{16} \zeta(3). \end{align}

And

\begin{align} \int^{\pi /2}_{0} x \cot(x) \ dx &= 2 \sum_{n=1}^{\infty} \int_{0}^{\pi /2} x \sin(2nx) \ dx \\ &= -\frac{\pi}{2} \sum_{n=1}^{\infty} \frac{(-1)^{n}}{n} \\ &= \frac{\pi \ln 2}{2} . \end{align}

Therefore,

\begin{align} \int_{0}^{\pi /2} \frac{x^{4}}{\sin^{4} x} \ dx &= \frac{8}{3} \left( \frac{\pi^{3}}{8} \ln (2) - \frac{9 \pi }{16} \zeta(3) \right) - \frac{\pi^{3}}{12} + 4 \left(\frac{\pi \ln 2}{2} \right) \\ &= - \frac{\pi^{3}}{12} + 2 \pi \ln(2) + \frac{\pi^{3}}{3} \ln (2) - \frac{3 \pi}{2} \zeta(3) . \end{align}

For $n\in\mathbb{N}$ we have:

$$\int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^ndx=\sum\limits_{j=0}^{n-1}2^{n-j}\begin{bmatrix}n\\j+1\end{bmatrix}\sum\limits_{v=0}^j\binom{j}{v}(-n)^{j-v+1}\sum\limits_{l=1}^{\big\lfloor\frac{n+1}{2}\big\rfloor}\frac{(-1)^l\Big(\tfrac{\pi}{2}\Big)^{n-2l+1}}{(n-2l+1)!}f_n(2l-v),$$

with the Stirling numbers of the first kind $\begin{bmatrix}n\\k\end{bmatrix}$ defined by $\displaystyle\sum\limits_{k=0}^n\begin{bmatrix}n\\k\end{bmatrix}x^k:=\prod\limits_{k=0}^{n-1}(x+k),$

with $f_{2m-1}(s):=(-1)^{m-1}\beta(s),$ where $\beta(s)$ := Dirichlet $\beta$ function,

and $f_{2m}(s):=(-1)^{m-1}2^{-s}\eta(s),$ where $\eta(s)$ := Dirichlet $\eta$ function,

for $m\in\mathbb{N}$, with the analytical extensions $(s\in\mathbb{C})$

\begin{align} \beta(1-s)&=\bigg(\dfrac{2}{\pi}\bigg)^s\sin\bigg(\dfrac{\pi s}{2}\bigg)~\Gamma(s)~\beta(s) \\\\ \eta(1-s)&=\dfrac{2^s-1}{1-2^{s-1}}~\pi^{-s}\cos\bigg(\dfrac{\pi s}{2}\bigg)~\Gamma(s)~\eta(s) \end{align}

and with the simplifications $(k\in\mathbb{N}_0)$

\begin{align} \beta(-2k-1)~&=~0 \\\\ \beta(-2k)~&=~-\frac{2^{4k+1}}{2k+1}~B_{2k+1}\bigg(\frac{1}{4}\bigg) \\\\ \beta(2k+1)~&=~(-1)^{k-1}~\frac{(2\pi)^{2k+1}}{2(2k+1)!}~B_{2k+1}\bigg(\frac{1}{4}\bigg) \\\\ \eta(1-k)~&=~\frac{2^k-1}{k}~B_k \\\\ \eta(2k)~&=~(-1)^{k-1}~\frac{2^{2k-1}-1}{(2k)!}~B_{2k}~\pi^{2k} \\\\ \eta(2k+1)~&=~\bigg(1-\frac{1}{2^{2k}}\bigg)\zeta(2k+1) \end{align}

Examples include:

\begin{align} \int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^1dx~&=~2\beta(2)\approx1.83 \\\\ \int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^2dx~&=~\pi\ln2\approx2.178 \\\\ \int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^3dx~&=~-6\beta(4)+\bigg(\frac{3}{4}\pi^2+6\bigg)\beta(2)-\frac{3}{8}\pi^2\approx2.64 \\\\ \int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^4dx~&=~-\frac{3}{2}\pi\zeta(3)+\bigg(\frac{\pi^3}{3}+2\pi\bigg)\ln2-\frac{\pi^3}{12}\approx3.27 \\\\ \int\limits_0^{\pi/2}\bigg(\frac{x}{\sin x}\bigg)^5dx~&=~90\beta(6)-\bigg(\frac{45}{4}\pi^2+100\bigg)\beta(4)+\bigg(\frac{45}{192}\pi^4+\frac{25}{4}\pi^2+10\bigg)\beta(2)- \\ &-\bigg(\frac{55}{384}\pi^4+\frac{5}{8}\pi^2\bigg)\approx4.135 \end{align}

• Fantastic and underrated answer. Aug 14, 2017 at 2:04
• @BrevanEllefsen : Very kind of you, thanks ! (But: for a better rating I should explain more of course ... :-) ) Aug 14, 2017 at 8:27
• How do we know your initial claim? Mar 3, 2019 at 2:33
• @clathratus : I have to explain more, of course, but it's a lot, I need too much time for it. And my answer came 2 years too late. Therefore I wrote only the answer for interested people, not the whole explanation. If you like to do busywork, you should start with $\sin x = (e^{ix}-e^{-ix})/(i2)$, the rest comes on its own. By the way: You can also look at here for similar ideas. Mar 3, 2019 at 16:11

Integrating by parts, we have $$\int \frac{x^2}{\sin^2 x} \, dx= -x^2 \cot x +\int 2x \cot x \, dx\\= -x^2 \cot x + 2x \ln \sin x - \int 2 \ln \sin x \, dx$$ Evaluating this between $0$ and $\pi/2$, we find that the boundary terms vanish (by taking the appropriate limits), so we are left with the well-known integral $$-2 \int_0^{\pi/2} \ln \sin x \, dx =\pi \ln 2$$

Edit: I have found a way to do $I_1$. Integrating by parts, $$\int \frac{x}{\sin x} \, dx= x \ln \tan \frac{x}{2} - \int \ln \tan \frac{x}{2} \, dx$$ Evaluating between $0$ and $\pi/2$ yields $$I_1 = -2 \int_0^{\pi/4} \ln \tan x \, dx\\ = -2 \int_{-\infty}^{0} x \frac{e^x}{1+e^{2x}} \, dx\\ = 2 \sum_{k \geq 0} (-1)^k\int_{0}^{\infty} x e^{-(2k+1)x} \, dx \\ = 2 \sum_{k \geq 0} (-1)^k \frac{1}{(2k+1)^2} \\ = 2C$$ as was to be proved.

Using a CAS, I obtained $$I_3=\frac{1}{256} \left(192 \left(8+\pi ^2\right) C-96 \pi ^2-\psi ^{(3)}\left(\frac{1}{4}\right)+\psi ^{(3)}\left(\frac{3}{4}\right)\right)$$ $$I_6=\frac{1}{320} \pi \left(40 \pi ^2 (-12 \zeta (3)-1+20 \log (2))+240 (15 (\zeta (5)-\zeta (3))+\log (16))+\pi ^4 (32 \log (2)-11)\right)$$

• Are you will to share the name of the CAS? My old Maple give solutions only in terms of $\mathrm{polylog}(n,\pm i)$ and Wolfram Alpha shows only numerical values? May 8, 2014 at 12:28
• It is a modiied version of Maxima. I must say that I got a lot of trouble with $I_5$. May 8, 2014 at 12:31
• @ClaudeLeibovici : The maxima which I've installed (v5.24.0) can't integrate even when n=1. Is that modified version available online?
– gar
May 9, 2014 at 10:38
• @gar. No, it is a version we have modified in my research team many years ago precisely for integration of very nasty functions we worked on at that time. If life is not too short, it is part of my plans to clean it up and propose it to whoever could be interested. May 9, 2014 at 10:51
• @ClaudeLeibovici : Oh, I see. That would be a great thing to do! Thanks for your time and work.
– gar
May 9, 2014 at 10:56