<s>[INST] Integration - Partial Fraction Decomposition I was wondering if someone would be kind enough to walk me through the logic used in solving the following integral. I have been to class, and have read the section (9.4 of Swokowski's Classic), and have studied the answer in the solution manual, but I can't quite seem to make sense of the rules posed (p.474, Swokowski's Classic) for the decomposition.
$$
\int\frac{x^2+3x+1}{x^4+5x^2+4}dx
$$
Factors to:
$$
\int\frac{x^2+3x+1}{(x^2+4)(x^2+1)}dx
$$
And this is where I get completely lost. I can do simple ones, such as
$$
\int\frac{x+16}{x^2+2x-8}
$$
where they reduce to 
$$
\frac{A}{x+4} + \frac{B}{x-2}
$$
But the solution manual suggests that A and B should be Ax+B and Cx+D, referring to the aforementioned rule, and I'm quite confused.
Thank you very much!
 [/INST] Procedure of decomposition
So:
$$\frac{x^2+3x+1}{(x^2+4)(x^2+1)} = \frac{ax+b}{x^2+4}+\frac{cx+d}{x^2+1} \Rightarrow$$
$$ \Rightarrow x^2+3x+1 =(x^2+1)(ax+b)+(x^2+4)(cx+d) \Rightarrow$$
$$\Rightarrow x^2+3x+1 =(a+c)x^3+(b+d)x^2+(a+4c)x+(b+4d)$$
Therefore , you have to solve following system of equations :
$\begin{cases}
 a+c=0 \\
 b+d=1 \\
 a+4c=3 \\
 b+4d=1
\end{cases}$
After you find coefficients : $a,b,c,d$ use sum of integrals :
$$\int\frac{ax+b}{x^2+4} \,dx =\int\frac{ax}{x^2+4} \,dx+\int\frac{b}{x^2+4} \,dx$$
$$\int\frac{cx+d}{x^2+1} \,dx =\int\frac{cx}{x^2+1} \,dx+\int\frac{d}{x^2+1} \,dx$$
</s>