Computing the indefinite integral $\int x^n \sin x\,dx$ $\newcommand{\term}[3]{
  \sum_{k=0}^{\lfloor #1/2 \rfloor} (-1)^{#2} x^{#3} \frac{n!}{(#3)!}
}$
I am trying to prove that for $n \in\mathbb N$,
$$
\int x^n \sin x \, dx
= \cos x \term{n}{k+1}{n-2k}
+ \sin x \term{(n-1)}{k}{n-2k-1}
$$
I started with differentiation, and this is what I got:
If we define $f(x)$ as
$$
f(x)
= \cos x \term{n}{k+1}{n-2k}
+ \sin x \term{n-1}{k}{n-2k-1}
$$
then we have
$$
\begin{align*}
f’(x)
&= \cos x \term{n}{k+1}{n-2k-1}
 - \sin x \term{n}{k+1}{n-2k} \\
&\qquad
 + \sin x \term{(n-1)}{k}{n-2k-2}
 + \cos x \term{(n-1)}{k}{n-2k-1} \\[8pt]
&= \cos x \left[
   \term{n}{k+1}{n-2k-1}
 + \term{(n-1)}{k}{n-2k-1}
\right] \\
&\qquad
 + \sin x \left[
   \term{(n-1)}{k}{n-2k-2}
 - \term{n}{k+1}{n-2k}
\right]
\end{align*}
$$
I don't know how to go on, because of the different limits of the sum with $\lfloor{n/2}\rfloor$ and $\lfloor{(n-1)/2}\rfloor$.

Integrate by parts twice, and use two inductions (odd and even case). You may be able to unite these if you are skillful.
