# Expand terms of series in denominator

I have equation:

$a+bx+cx^2+dx^3= \dfrac{1}{f+gx+hx^2+ix^3} \dfrac{\partial}{\partial r}(ax+bx^2+cx^3+dx^4) +\dfrac{1}{(f+gx+hx^2+ix^3)^2} \dfrac{\partial^2}{\partial r^2}(ax^2+bx^3+cx^4+dx^5)$

where I need to extract terms which are multipliers of $x^0$, $x^1$, $x^2$, $x^3$ (it need to be sum of particular terms, for example right side need to be in shape $Ax+Bx^2+Cx^3+D$). Constants are $a$, $b$, $c$, $d$, $g$, $f$, $i$, $h$.

The biggest problem for me are parts with denominator on the right side of equation $\dfrac{1}{f+gx+hx^2+ix^3}$ and $\dfrac{1}{(f+gx+hx^2+ix^3)^2}$,

I dont know how to extract these terms which are multipliers of $x^0$, $x^1$, $x^2$, $x^3$?

Until now functions in Mathematica Apart, Expand, ExpandAll, Collect simplify didnt give me results, am I looking in right area of math operations?

• If x is small you can use taylor series. Otherwise there is no way to express rational expression as a polynome. Commented Mar 6, 2018 at 11:22
• I think you have to use Series command, because power is neagive that contain infinite term of x. Commented Mar 6, 2018 at 11:36

         Series[(f + g*x + h*x^2 + i*x^3)^-1, {x, 0, 5}]
Series[(f + g*x + h*x^2 + i*x^3)^-2, {x, 0, 5}]
and output are
(*1/f-(g x)/f^2+((g^2-f h) x^2)/f^3+((-g^3+2 f g h-f^2 i) \
x^3)/f^4+((g^4-3 f g^2 h+f^2 h^2+2 f^2 g i) x^4)/f^5+((-g^5+4 f g^3 \
h-3 f^2 g h^2-3 f^2 g^2 i+2 f^3 h i) x^5)/f^6+O[x]^6*)
(*1/f^2-(2 g x)/f^3+((3 g^2-2 f h) x^2)/f^4-(2 (2 g^3-3 f g h+f^2 i) \
x^3)/f^5+((5 g^4-12 f g^2 h+3 f^2 h^2+6 f^2 g i) x^4)/f^6+(2 (-3 \
g^5+10 f g^3 h-6 f^2 g h^2-6 f^2 g^2 i+3 f^3 h i) x^5)/f^7+O[x]^6*)
`