Integrating the Difference between Sine and its Maclaurin Series The integral in question:
Let $n$ be a nonnegative integer.
$$
\int_0^\infty 
\frac{1}{x^{2n+3}} 
\left ( 
\sin x - 
\sum_{k=0}^n \frac{(-1)^k x^{2k+1}}{(2k + 1)!}
\right )
\mathrm{d}x
$$
I was given this problem to try for fun from a professor about two months ago and haven't made a dent in it.
If possible, I'd like someone to show how they get to their answer, but please keep in mind that I haven't learned contour integration or complex analysis, but know of a few tricks like Feynman's.
What I've tried:
Writing out the terms to integrate by segments, using the Cosine Maclaurin series and substituting (pi/2 -x) to get the Sine series in a different way, integration by parts (2n+3) times or such to simplify, and a lot more I'm probably forgetting.
I know this site is full of integral-calculating gods, so if this piques your interest please have an attempt and share below.
 A: This can be done via Integration by Parts.
$$
\begin{align}
&\int_0^\infty\frac1{x^{2n+3}}\left(\sin(x)-\sum_{k=0}^n\frac{(-1)^kx^{2k+1}}{(2k+1)!}\right)\mathrm{d}x\\
&=\frac{-1}{(2n+1)(2n+2)}\int_0^\infty\frac1{x^{2n+1}}\left(\sin(x)-\sum_{k=0}^{n-1}\frac{(-1)^kx^{2k+1}}{(2k+1)!}\right)\mathrm{d}x\tag1\\
&=\frac{(-1)^{n+1}}{(2n+2)!}\int_0^\infty\frac1x\,\sin(x)\,\mathrm{d}x\tag2\\[3pt]
&=\frac{(-1)^{n+1}}{(2n+2)!}\frac\pi2\tag3
\end{align}
$$
Explanation:
$(1)$: integrate by parts twice
$(2)$: repeat $(1)$ $n$ more times
$(3)$: see $(9)$ from this answer
A: Hoping that you enjoy hypergeometric functions
$$I_n=\int_0^\infty 
\frac{1}{x^{2n+3}} 
\left ( 
\sin x - 
\sum_{k=0}^n \frac{(-1)^k x^{2k+1}}{(2k + 1)!}
\right )
\,dx$$
$$\sum_{k=0}^n \frac{(-1)^k x^{2k+1}}{(2k + 1)!}=\frac{(-1)^n x^{2 n+3} \,
   _1F_2\left(1;n+2,n+\frac{5}{2};-\frac{x^2}{4}\right)}{(2 n+3)!}+\sin (x)$$
$$I_n=\frac{(-1)^{n+1}}{\Gamma (2 n+4)}\int_0^\infty \, _1F_2\left(1;n+2,n+\frac{5}{2};-\frac{x^2}{4}\right)\,dx$$
$$I_n=(-1)^{n+1}\,\frac{   \pi}{2\,\Gamma (2 n+3)}$$
