<s>[INST] 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!
 [/INST] 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.
</s>