<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] Since $x^5 = \left(x^2 + 1\right)\left(x^3 - x\right) + x$, we have that
$$\cfrac{x^5}{x^2 + 1} = x^3 - x + \cfrac{x}{x^2 + 1} \tag{1}\label{eq1} $$
To do this in general, first note that $x^2$ divides into $x^5$ a total of $x^3$ times. However, this gives $x^3\left(x^2 + 1\right) = x^5 + x^3$, so it's too big by $x^3$.  As such, you need to subtract an appropriate value, with it being $x$ here due to $x \times x^2 = x^3$.  However, $x\left(x^2 + 1\right) = x^3 + x$, so subtracting this means that you are now $x$ too small, so you need to add that $x$ back. However, as the degree of $x$ is only $1$, which is less than the degree of $2$ in $x^2 + 1$, you leave that final $x$ as the remainder.  This, in total, gives \eqref{eq1}.
</s>