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!

Notice that:
$$
\frac{x^2 - 3}{x^2 + 1} = \frac{(x^2 + 1) - 4}{x^2 + 1}
= \frac{x^2 + 1}{x^2 + 1} - \frac{4}{x^2 + 1}
= 1 - \frac{4}{x^2 + 1}
$$
The hard part is the first step. Basically, we want the denominator to show up in the numerator somehow so that they cancel out nicely. So we apply wishful thinking and try to force the denominator to show up somehow by any means necessary.
