<s>[INST] Polynomial Long Division Confusion (simplifying $\frac{x^{5}}{x^{2}+1}$) I need to simplify \begin{equation}
\frac{x^{5}}{x^{2}+1}
\end{equation}
by long division in order to solve an integral. 
However, I keep getting an infinite series:
\begin{equation}
x^{3}+x+\frac{1}{x}-\frac{1}{x^{3}}+...
\end{equation}
 [/INST] The idea of polynomial division is like integer division. With integer division of $\frac nd$, we want integer $q,r$ so that $n=qd+r$ and $r\lt d$. With polynomial division of $\frac nd$, we want polynomial $q,r$ so that $n=qd+r$ and $\deg(r)\lt \deg(d)$.
$$
\require{enclose}
\begin{array}{rl}
&\phantom{)\,}\color{#C00}{x^3}\color{#090}{-x}\\[-4pt]
x^2+1\!\!\!\!\!&\enclose{longdiv}{x^5\qquad}\\[-4pt]
&\phantom{)\,}\underline{\color{#C00}{x^5+x^3}}\\[-2pt]
&\phantom{)\,x^5}{}-x^3\\[-4pt]
&\phantom{)\,x^5}\underline{\color{#090}{{}-x^3-x}}\\[-4pt]
&\phantom{)\,x^5{}-x^3-{}}x\\[-4pt]
\end{array}
$$
So we get a quotient of $x^3-x$ and a remainder of $x$, which allows us to write both
$$
\overbrace{\quad\,x^5\quad\,}^n=\overbrace{\left(x^3-x\right)}^q\overbrace{\left(x^2+1\right)}^d+\overbrace{\vphantom{x^5}\quad\;x\quad\;}^r
$$
and
$$
\frac{x^5}{x^2+1}=x^3-x+\frac{x}{x^2+1}
$$
</s>