# Calculating $\int_0^{\pi/2} (x \sin x)^n dx$

Define $$I_n = \int_0^{\pi/2} (x \sin x)^n dx$$ for $$n \ge 0$$.

I calculate the value for $$n = 0, 1$$ and $$2$$. $$I_0 = \frac{\pi}{2}, \>\>\>I_1 = 1, \>\>\>I_2 = \frac{{\pi}^3 + 6 \pi}{48} .$$

In general, what's the value of $$I_n$$?

P.S. WolframAlpha produces

$$I_3 = \frac{7{\pi}^2}{12} - \frac{122}{27},$$ $$I_4 = \frac{6{\pi}^5 + 170 {\pi}^3 -975 \pi}{2560},$$ $$I_5 = \frac{149{\pi}^4}{720} - \frac{31841{\pi}^2}{3375} + \frac{56992552}{759375}\\$$

• If you know any complex numbers, then you can realize that sin(x) is the imaginary part of $e^{ix}$. $xe^{ix}$ is easier to integrate. Mar 4, 2016 at 17:31
• @Kaynex: however, $\sin(x)^n$ is not the imaginary part of $(e^{ix})^n$. Mar 4, 2016 at 17:47
• Derp, that's true. Slipped right past me. Mar 4, 2016 at 17:55
• Try to find a recurrence relation, if at all possible. Mar 5, 2016 at 4:08

$$\int_0^{\pi/2} x^n\sin^n(x)\ \text{d}x = \int_0^{\pi/2} x^n\ \left(\frac{e^{ix} - e^{-ix}}{2i}\right)^n\ \text{d}x$$
But I warn you, it's not an easy road. You'll have to integrate by parts $n$ times. You'll end up almost surely with some hellish Hypergeometric Function.
Denote $$J_{m,n}= \int_0^{\pi/2} x^m\sin^n x \ dx$$, which can be evaluated via the reduction formula $$J_{m,n}=\frac{n-1}{n} J_{m,n-2} -\frac{m(m-1)}{n^2} J_{m-2,n} + \frac m{n^2}\left(\frac\pi2\right)^{m-1}$$ Then, evaluate $$I_n= \int_0^{\pi/2} (x\sin x)^n dx=J_{n,n}$$ recursively as follows \begin{align} I_0=&\ J_{0,0}=\frac\pi2\\ \\ I_1=&\ J_{1,1}=1\\ \\ &\ J_{0,2}=\frac\pi4, \> J_{2,0}=\frac{\pi^3}{24}\\ I_2=&\ J_{2,2}=\frac12 J_{2,0}-\frac12 J_{0,2}+\frac\pi4 = \frac{\pi^3}{48}+\frac{\pi}8\\ \\ & \ J_{1,3}= \frac23J_{1,1}+\frac19=\frac79,\> J_{3,1}= -6 J_{1,1}+\frac{3\pi^2}4 =\frac{3\pi^2}4-6\\ I_3=&\ J_{3,3}=\frac23 J_{3,1}-\frac23 J_{1,3}+\frac{\pi^2}{12} = \frac{7\pi^2}{12}-\frac{122}{27}\\ \\ &\ J_{0,4}=\frac{3\pi}{16}, \> J_{4,0}=\frac{\pi^5}{160}\\ &\ J_{2,4}=\frac34J_{2,2}-\frac18J_{0,4}+\frac{\pi}{16} = \frac{\pi^3}{64}+\frac{17\pi}{128}\\ &\ J_{4,2}=\frac13 J_{4,0}-3 J_{2,2}+\frac{\pi^3}{8} = \frac{\pi^5}{320}+\frac{\pi^3}{16}-\frac{3\pi}{8}\\ I_4=&\ J_{4,4}=\frac34 J_{4,2}-\frac34J_{2,4}+\frac{\pi^3}{32} = \frac{3\pi^5}{1280}+\frac{17\pi^3}{256}-\frac{195\pi}{512}\\ \end{align}