<s>[INST] Partial Fraction problem solution deviates from the Rule Question:
Compute $\displaystyle \int\frac{x^2+1}{(x^2+2)(x+1)} \, dx$
My Approach:
As per my knowledge this integral can be divided in partial Fraction of form $\dfrac{Ax+B}{x^2+px+q}$ and then do the following as per to integrate it.
Solution:
Taking $\dfrac{x^2+1}{(x^2+2)(x+1)}=\dfrac{Ax^2+Bx+C}{x^2+2}+\dfrac{D}{x+1}$
Rule given: Denominator g(x) contains quadratic tractor (may not be factorisable).
To each non-repeated quadratic factor of the form $x^2+px+q$(or $x^2+q$, $q$ not equal to $0$), there
Should be a partial Fraction of the form $Ax+B/(x^2+px+q)$.
My problem:
I can't understand why the solution provided deviates from the rule that I have studied to solve these kind of problems.
Book:
ISC MATHEMATICS XII
Publishers:
Kalyani
 [/INST] you must write $$\frac{x^2+1}{(x^2+2)(x+1)}=\frac{Ax+B}{x^2+2}+\frac{C}{x+1}$$
</s>