<s>[INST] integration by partial fraction I can not figure out how to integrate 
$$\int\frac{3x^2+x+4}{x^3+x} \, dx.$$
I got as far as factoring the denominator which gives us $x(x^2+1)$.
So from there I got
$$\frac{3x^2+x+4}{x(x^2+1)} = \frac{A}{x} + \frac{Bx+C}{x^2+1}$$
which would give us: $(3x^2 + x + 4) = A(x^2 + 1) + (Bx+C)x$
This is where Im stuck because I can not figure out the values for $B$ and $C$. Please help.
 [/INST] Observe that:
$$
\begin{align}\frac{3x^2+x+4}{x^3+x}=\frac{3(x^2+1)-2x+1}{x(x^2+1)}&=\frac{3}{x}-\frac{2}{x^2+1}+\frac{1}{x}-\frac{x}{x^2+1}\\
&=\frac{4}{x}-\frac{2+x}{x^2+1}
\end{align}$$
and the rest should be easy.
</s>