<s>[INST] Partial fraction decomposition of a complicated rational function Find the partial fraction decomposition of the rational function $\displaystyle \frac{2x^3+7x+5}{(x^2+x+2)(x^2+1)}$
I have tried dividing first but keep running into problem after problem, please help.
 [/INST] Step 1: Find $a, b, c, d$ such that:  $\dfrac{2x^3 + 7x + 5}{(x^2 + x + 2)(x^2 + 1)} = \dfrac{ax + b}{x^2 + x + 2} + \dfrac{cx + d}{x^2 + 1}$
Step 2: Rewrite:
 $\dfrac{ax + b}{x^2 + x + 2} + \dfrac{cx+d}{x^2 + 1} = \dfrac{1}{2}\cdot \dfrac{a(2x+1)}{x^2 + x + 2} + \dfrac{1}{2}\cdot\dfrac{2b - a}{(x + \frac{1}{2})^2 + (\frac{\sqrt{7}}{2})^2} + \dfrac{c}{2}\cdot \dfrac{2x}{x^2 + 1} + d\cdot\dfrac{1}{x^2+1}$.
Step 3: Make the right substitution and complete answer.
</s>