<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] When dividing one polynomial by another, you expect a polynomial quotient. For example, when you divide $x^3+x+1$ by $x+1$, 


*

*First multiply $x+1$ by $x^2$ and subtract the result, $x^3+x^2$, from $x^3+x+1$, giving the remainder $-x^2+x+1$;

*Now, multiply $x+1$ by $-x$ and subtract the result, $-x^2-x$, from $-x^2+x+1$, giving the remainder $2x+1$;

*As a final step, multiply $x+1$ by $2$ and subtract the result, $2x+2$, from $2x+1$, giving you the remainder $-1$. Thus,$$x^3+x+1=(x+1)(x^2-x+2)-1$$ 
Note that you don't go beyond the last step, because the degree of the remainder, $2,(0)$ is smaller than the degree of the divisor, $x+1, (1)$. To go any further, you will have to multiply $x+1$ by terms containing negative powers of $x$, which would mean the quotient will no longer be a polynomial in $x$. Moreover, there is no guarantee that this procedure will terminate, as you have seen.
The essence of performing long-division to solve the integral $$\int\frac{x^5}{x^2+1}dx$$ is to express $x^5=(x^2+1)Q(x)+R(x)$, where $Q(x),R(x)$ are polynomials in $x$ with degree of $R(x)<2$, which is the degree of the divisor, $x^2+1$. 
This gives $$\frac{x^5}{x^2+1}=Q(x)+\frac{R(x)}{x^2+1}$$where $Q(x)$ can be easily integrated because it is a polynomial, and $\displaystyle\frac{R(x)}{x^2+1}$ can be integrated using partial fractions or similar techniques.
As other answers have pointed out, $$\int\frac{x^5}{x^2+1}dx=\int x^3-x+\frac x{x^2+1}dx=\frac{x^4}4-\frac{x^2}2+\frac12\ln(x^2+1)+C$$
</s>