In school we have just started with integration by parts. We had examples like $∫x\sin(x)\,dx$ or $∫x^2\sin(x)\,dx$ I asked myself if it is possible to integrate terms like $∫x^{25}\sin(x)\,dx$ without doing integration by parts 25 times. I can't tell how exactly I did it, but I integrated some explicit terms and created this: $$\int x^n\sin x\,dx=\sum_{k=0}^{\lfloor n/2\rfloor}(-1)^{k+1}x^{n-2k}{n!\over(n-2k)!}\cos x+\sum_{k=0}^{\lfloor(n-1)/2\rfloor}(-1)^kx^{n-2k-1}{n!\over(n-2k-1)!}\sin x$$
with $n\in \Bbb N$.
I tested it a few times and I think that it is correct, but I don't have any idea how to prove it. How can I do that?