Instead, let's use induction and (iterated) integration by parts. (Note that there should be a "${}+C$ " in that formula, but I'm not going to worry about that.)
First, let's take any $n\ge 1$ and integrate $\int x^n\sin x\,dx$ by parts to see what happens. By the LIATE Rule, we should take $u_1=x^n$ and $dv_1=\sin x\,dx$, giving us $du_1=nx^{n-1}\,dx$ and $v_1=-\cos x$. Then $\int x^n\sin x\,dx=\int u_1\,dv_1=u_1v_1-\int v_1\,du_1=-x^n\cos x+n\int x^{n-1}\cos x\,dx.$ The integral on the far right is easy when $n=1$, but if $n\ge 2$ then it's only slightly less problematic than the integral we started with. Still, it's an improvement, so we'll bear it in mind: $\int x^n\sin x\,dx=-x^n\cos x+n\int x^{n-1}\cos x\,dx\quad\quad\text{for }n\ge 1.\tag{1}$ Now let's suppose $n\geq 2$, and integrate $\int x^{n-1}\cos x\, dx$ by parts. Take $u_2=x^{n-1}$ and $dv_2=\cos x\,dx$, so $du_2=(n-1)x^{n-2}\, dx$ and $v_2=\sin x$. Then $\int x^{n-1}\cos x\,dx=\int u_2\,dv_2=u_2v_2-\int v_2\,du_2=x^{n-1}\sin x-(n-1)\int x^{n-2}\sin x\,dx,$ so by $(1)$, we have $\begin{align}\int x^n\sin x\, dx &= -x^n\cos x+n\int x^{n-1}\cos x\,dx\\ &= -x^n\cos x+nx^{n-1}\sin x-n(n-1)\int x^{n-2}\sin x\,dx.\end{align}$ Hence, we've rewritten the original integral in terms of polynomial combinations of $\sin x$ and $\cos x$, together with an integer multiple of an integral much like the one we started with, but with a power of $x$ that is $2$ smaller. This will allow us to make an inductive argument, but with jumps of $2$, so we'll need $2$ base cases instead of $1$. Namely, we'll need base cases $n=1,2$, and we'll induce along the odd $n$ and the even $n$ separately. Let's bear it in mind: $\int x^n\sin x\, dx=-x^n\cos x+nx^{n-1}\sin x-n(n-1)\int x^{n-2}\sin x\,dx\quad\text{for }n\ge 2.\tag{2}$
For the $n=1$ case, we can simply use $(1)$ to get $\int x\sin x\,dx=-x\cos x+\int\cos x\,dx=-x\cos x+\sin x.$ On the other hand, the following $4$ lines are all equal:
$\sum_{k=0}^{\lfloor{1/2}\rfloor}(-1)^{k+1}x^{1-2k}{1!\over(1-2k)!}\cos x+\sum_{k=0}^{\lfloor{(1-1)/2}\rfloor}(-1)^kx^{1-2k-1}{1!\over(1-2k-1)!}\sin x$
$\sum_{k=0}^0(-1)^{k+1}x^{1-2k}{1\over(1-2k)!}\cos x+\sum_{k=0}^0(-1)^kx^{-2k}{1\over(-2k)!}\sin x$
$(-1)^{0+1}x^{1-0}{1\over(1-0)!}\cos x+(-1)^0x^{0}{1\over(0)!}\sin x$ $-x\cos x+\sin x,$ so we're okay in the first base case.
For the $n=2$ case, we can similarly use $(2)$ and calculate the sums explicitly to confirm that the formula holds.
Now, let's do the odd induction. We're considering all $n=2m-1$ ($m\in\Bbb N$). Let's substitute this into the desired formula to get what we're trying to prove in terms of $m$, instead. Observing that that $\lfloor\frac{n}2\rfloor=\lfloor m-\frac12\rfloor=m-1$ and $\lfloor\frac{n-1}2\rfloor=\lfloor m-1\rfloor=m-1,$ we want to show that $\begin{align}\int x^{2m-1}\sin x\,dx=\sum_{k=0}^{m-1}(-1)^{k+1}x^{2m-1-2k}{(2m-1)!\over(2m-1-2k)!}\cos x\\+\sum_{k=0}^{m-1}(-1)^kx^{2m-2-2k}{(2m-1)!\over(2m-2-2k)!}\sin x\end{align}\tag{3}$ for all $m\in\Bbb N$. We already know the formula holds in the $m=1$ ($n=1$) case, and by $(2)$, we have $\begin{align}\int x^{2(m+1)-1}\sin x\, dx=-x^{2(m+1)-1}\cos x+\bigl(2(m+1)-1\bigr)x^{2(m+1)-2}\sin x\\-\bigl(2(m+1)-1\bigr)\bigl(2(m+1)-2\bigr)\int x^{2m-1}\sin x\,dx\end{align}\tag{4}$ for all $m\geq 1$.
Suppose for some $m$ that $(3)$ holds. Note that for any function $f(x)$, we have $\sum\limits_{k=0}^{m-1}f(k)=\sum\limits_{k=1}^mf(k-1)$. Using this reindexing trick, we have by $(3)$ that $\begin{align}\int x^{2m-1}\sin x\,dx &=\sum_{k=0}^{m-1}(-1)^{k+1}x^{2m-1-2k}{(2m-1)!\over(2m-1-2k)!}\cos x\\ &{}\qquad+\sum_{k=0}^{m-1}(-1)^kx^{2m-2-2k}{(2m-1)!\over(2m-2-2k)!}\sin x\\ &=\sum_{k=1}^{m}(-1)^{(k-1)+1}x^{2m-1-2(k-1)}{(2m-1)!\over(2m-1-2(k-1))!}\cos x\\ &{}\qquad+\sum_{k=1}^{m}(-1)^{k-1}x^{2m-2-2(k-1)}{(2m-1)!\over(2m-2-2(k-1))!}\sin x\\ &=(-1)^{-1}\sum_{k=1}^{m}(-1)^{k+1}x^{2m+1-2k}{(2m-1)!\over(2m+1-2k))!}\cos x\\ &{}\qquad+(-1)^{-1}\sum_{k=1}^{m}(-1)^{k}x^{2m-2k}{(2m-1)!\over(2m-2k)!}\sin x\\ &=-\sum_{k=1}^{(m+1)-1}(-1)^{k+1}x^{2(m+1)-1-2k}{(2(m+1)-3)!\over(2(m+1)-1-2k))!}\cos x\\ &{}\qquad-\sum_{k=1}^{(m+1)-1}(-1)^{k}x^{2(m+1)-2k}{(2(m+1)-3)!\over(2(m+1)-2-2k)!}\sin x,\end{align}$ and so $\begin{align}-\bigl(2(m+1)-1\bigr)\bigl(2(m+1)-2\bigr)\int x^{2m-1}\sin x\,dx =\sum_{k=1}^{(m+1)-1}(-1)^{k+1}x^{2(m+1)-1-2k}{(2(m+1)-1)!\over(2(m+1)-1-2k))!}\cos x\\ {}\qquad+\sum_{k=1}^{(m+1)-1}(-1)^{k}x^{2(m+1)-2k}{(2(m+1)-1)!\over(2(m+1)-2-2k)!}\sin x.\end{align}$ Thus, since $-x^{2(m+1)-1}\cos x=(-1)^{0+1}x^{2(m+1)-1-0}{(2(m+1)-1)!\over(2(m+1)-1-0)!}\cos x$ and $(2(m+1)-1)x^{2(m+1)-2}\sin x=(-1)^{0}x^{2(m+1)-2-0}{(2(m+1)-1)!\over(2(m+1)-2-0)!}\sin x,$ we have by $(4)$ and the above work that $\begin{align}\int x^{2(m+1)-1}\sin x\,dx=\sum_{k=0}^{(m+1)-1}(-1)^{k+1}x^{2(m+1)-1-2k}{(2(m+1)-1)!\over(2(m+1)-1-2k)!}\cos x\\+\sum_{k=0}^{(m+1)-1}(-1)^kx^{2(m+1)-2-2k}{(2(m+1)-1)!\over(2(m+1)-2-2k)!}\sin x,\end{align}$ and so the desired formula holds in the $m+1$ case, too.
For the even induction, we'll proceed in a similar fashion to the odd induction, except that we'll be considering $n=2m$ for $m\in\Bbb N$.