# Developing a fraction of infinite sums into a power series for integration

I want to express the function $$f(x) = \frac{1+a_1 x + a_2 x^2 + a_3 x^3 + \dots}{b_1 x + b_2 x^2 + b_3 x^3 + \dots + \log(x)\left[ c_2 x^2 + c_3 x^3 + c_4 x^4 + \dots \right]}$$ as a (generalized) power series for easier integration. Computer software has given me the result $$f = \frac{1}{b_1 x} - \left( \frac{c_2 \log(x)}{b_1^2} + \frac{b_2 -a_1 b_1}{b_1^2} \right) + \left( \frac{c_2^2 \log(x)^2}{b_1^3} - \frac{b_1 c_3 - 2 b_2 c_2 + a_1 b_1 c_2 \log(x)}{b_1^3} - \frac{b_1 b_3 - b_2^2 + a_1 b_1 b_2 - a_2 b_1^2}{b_1^3} \right) x + \dots$$

My questions: How do I find the general form of the series in terms of powers of $$x$$ and $$\log(x)$$? And how do I express the coefficients using indices and infinite sums?