How to find \begin{equation*} \int_0^{\pi/2} x\sin^n x dx \end{equation*} where $n$ is a positive integer? I tried $y=x-\pi/4$ and that gives \begin{equation*} \frac{1}{2^{n/2}}\frac{\pi}{4}\int_{-\pi/4}^{\pi/4} (\sin y+\cos y)^n dy+\frac{1}{2^{n/2}}\int_{-\pi/4}^{\pi/4} y(\sin y+\cos y)^n dy. \end{equation*} Although some terms may be canceled, the summation of the others seems terrible.
Another method is integration by parts. Here I found the recurrence formula for $\sin^n x$: Integrating $\int \sin^n{x} \ dx$
So the first step is to have \begin{equation*} \left.\left(-\frac{1}{n}x\cos x\sin^{n-1} x+\frac{n-1}{n}x\int \sin^{n-2} xdx\right)\right|_0^{\pi/2}-\int_0^{\pi/2}\left(-\frac{1}{n}\cos x\sin^{n-1} x+\frac{n-1}{n}\int_0^x \sin^{n-2} t dt\right)dx \end{equation*} the evaluations at $0$ and $\pi/2$ and the integral of $\cos x\sin^{n-1}x$ seem OK, but what about the second term? Any better method for this problem?