How do I go from this $\frac{x^2-3}{x^2+1}$ to $1-\frac{4}{x^2+1}$? So I am doing $\int\frac{x^2-3}{x^2+1}dx$ and on wolfram alpha it says the first step is to do "long division" and goes from $\frac{x^2-3}{x^2+1}$ to $1-\frac{4}{x^2+1}$. That made the integral much easier, so how would I go about doing that in a clear manner? Thanks in advance for the help!

$$
\begin{array}{ccccccccc}
& & 1 \\  \\
x^2 + 1 & ) & x^2 & - & 3 \\
& & x^2 & + & 1 \\  \\
& & & & -4 & \longleftarrow\text{remainder}
\end{array}
$$
The quotient is $1$ and the remainder is $-4$.
So $\displaystyle \frac{x^2-3}{x^2+1} = 1 - \frac{4}{x^2+1}$
