求 $I_n=\int_0^{\frac{\pi}{2}}\sin^n xdx$ 与 $I_n=\int_0^{\frac{\pi}{2}}\cos^n xdx$
\[ I_n=\begin{cases} \frac{(2k-1)!!}{(2k)!!}\cdot\frac{\pi}{2},&\text{if}\ n=2k;\\ \frac{(2k)!!}{(2k+1)!!},&\text{if}\ n=2k+1.\\ \end{cases} \]
类似的, 求
\[
I_n=\int_0^{\pi}x\cos^n xdx,\quad I_n=\int_0^{\pi}x\sin^n xdx.
\]