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.
 A: Okay, first a bunch of nitpicks:


*

*You are not trying to integrate the integral, you are trying to integrate the function itself.

*The integral does not equal the partial fraction decomposition, only the rational function itself does.

*You are missing the $dx$ in all the integrals.
So. You are trying to integrate $\displaystyle \frac{3x^2+x+4}{x^3+x}$. 
First, you make sure the numerator has smaller degree than the denominator, doing long division if necessary to get it into that form (done).
Then, you factor the denominator completely (done).
Then you set up the partial fraction decomposition problem (done):
$$\frac{3x^2+x+4}{x(x^2+1)} = \frac{A}{x} + \frac{Bx+C}{x^2+1}.$$
Then, you perform the operation on the right hand side to the expression you want (done):
$$\frac{3x^2+x+4}{x(x^2+1)} = \frac{A(x^2+1) + (Bx+C)x}{x(x^2+1)}.$$
Then, you know the numerators are equal (done):
$$3x^2 + x+4 = A(x^2+1)+ (Bx+c)x.$$
Finally, you figure out the values of $A$, $B$, and $C$. There are two strategies:


*

*Do the operations on the right and write it as a polynomial; since two polynomials are equal if and only if they have the same coefficients, the coefficient of $x^2$ on the right equals $3$, etc. This will set up a system of linear equations for $A$, $B$, and $C$, which you can solve:
$$3x^2 + x + 4 = Ax^2 + A + Bx^2 + Cx = (A+B)x^2 + Cx + A$$
so $A+B=3$, $C=1$, and $A=4$. From this, you get $A=4$, $B=-1$, and $C=1$, so
$$\frac{3x^2+x+4}{x(x+1)} = \frac{4}{x} + \frac{-x+1}{x^2+1}.$$
Now you just need to do the simpler integrals
$$\int\frac{3x^2+x+4}{x^3+x}\,dx = \int\frac{4}{x}\,dx - \int\frac{x}{x^2+1}\,dx + \int\frac{1}{x^2+1}\,dx.$$

*Plug in some values of $x$ to get information about $A$, $B$, and $C$. Specifically, pick values that make some of the terms equal to $0$ (the roots of the original polynomial), and start simplifying. For example, from
$$3x^2 + x + 4 = A(x^2+1) + (Bx+C)x,$$
plugging in $x=0$ you get $4 = A(1) + 0$, so $A=4$; now we have
$$3x^2 + x + 4 = 4x^2 + 4 + (Bx+C)x.$$
Moving all the known factors to the left, we have
$$-x^2 + x = (Bx+C)x$$
and factoring out $x$, we get
$x(-x+1) = (Bx+C)x$, from which you can cancel $x$ to get
$$-x+1 = Bx+C$$
which immediately gives $B=-1$ and $C=1$, as before. Now that we know $A$, $B$, and $C$, proceed as in 1.
A: Hint:
In the equation $(3x^2 + x + 4) = A(x^2 + 1) + (Bx+C)x$, by matching coefficients of the quadratic term $x^2$ we find:
$$A+B=3,$$
by matching coefficients of the linear term $x$ we find:
$$C=1,$$
and lastly, by matching the constant term we find:
$$A=4$$ 
Can you solve it from here?
A: 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.
