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!
 A: Hint:
$$\frac{x^{2}-3}{x^{2}+1}=\frac{(x^{2}+1)-4}{x^{2}+1}$$
A: Try to tackle this by doing a similar problem, i.e.

A: In this particular case
$$\frac{x^2-3}{x^2+1}=\frac{x^2+1-1-3}{x^2+1}=\frac{x^2+1}{x^2+1}-\frac{4}{x^2+1}=1-\frac{4}{x^2+1}$$
A: 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.
A: $$
\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}$
A: $\left( \frac{x^2 -3}{x^2 +1}\right) \Rightarrow \left(\frac {x^2}{x^2+1} - \frac {3}{x^2+1} \right) \Rightarrow \left(\frac{x^2+1}{x^2+1}  - \frac {1}{x^2+1} -\frac{3}{x^2+1} \right)\Rightarrow \left(1 -\frac {4}{x^2+1}\right) $
A: Since the residue in $x=i$ of $\frac{x^2-3}{x^2+1}$ is given by:
$$\lim_{x\to i}\frac{x-i}{x^2+1}(x^2-3)=(i^2-3)\lim_{x\to i}\frac{1}{2x}=2i$$
due to De l'Hospital theorem, and the residue in $x=-i$ is just the opposite due to the Schwarz reflection principle, we have that:
$$f(x)=\frac{x^2-3}{x^2+1}-\left(\frac{2i}{x-i}-\frac{2i}{x+i}\right)=\frac{x^2-3}{x^2+1}+\frac{4}{x^2+1}$$
is an entire function. That function is bounded when $|x|$ approaches $+\infty$, hence $f(x)$ is constant due to the Liouville's theorem, and $f(x)\equiv f(0)=1$, hence we have:
$$\frac{x^2-3}{x^2+1}=1-\frac{4}{x^2+1}$$
by exploiting just two or three quite advanced results.
