I need to expand the function $$ f(x)=\frac{(1-qx)^k}{(1-qx)^{k+1}-(px)^{k+1}},\quad p>0,\;q>0,\;p+q=1 $$ into a power series $$ \sum_{n=0}^{\infty} r_n x^n. $$ $k$ is an integer $>1$.
The only thing that comes to my mind is the Taylor series expansion, but here it does not inspire enthusiasm. Maybe there is some nice way?
Edit: Following the Ted Shifrin's hint, I got the product of the sums of geometric series $$ \frac{(1-qx)^k}{(1-qx)^{k+1}-(px)^{k+1}}=\frac1{1-qx}\cdot \frac1{1-\left( \frac{px}{1-qx} \right)^{k+1}}; $$ Then, $$ \frac1{1-qx}= 1+qx+q^2x^2+\ldots $$ $$ \frac1{1-\left( \frac{px}{1-qx} \right)^{k+1}}= 1+\left( \frac{px}{1-qx} \right)^{k+1}+ \left( \frac{px}{1-qx} \right)^{2(k+1)}+\ldots $$ $$ \left( \frac{px}{1-qx} \right)^{m(k+1)}= px^{m(k+1)}\frac1{\left( 1-qx \right)^{m(k+1)}}= px^{m(k+1)} \sum_{n=0}^\infty \binom{-m(k+1)}{n} q^n x^n $$ This is great progress, but it seems to me that this is not the end. It’s not for nothing that it’s given $p+q=1$. Does this somehow make things easier?
$$f(x)=\frac{(1-q x)^k}{(1-q x)^{k+1}-(p x)^{k+1}}$$ $$\frac 1{f(x)}=1-qx-p x \left(\frac {px}{1-qx}\right)^k$$
$$\left(\frac {px}{1-qx}\right)^k=(px)^k\sum_{n=0}^\infty (-1)^n \binom{-k}{n}q^n \,x^n$$ So, the reciprocal of $f(x)$ is simple.
Now, have fun with the long division.
If you use it for $$g_k(x)=\frac{(1-q x)^k}{(1-q x)^{k+1}-(p x)^{k+1}}$$ and you expand them to $O(x^{k+3})$, you have the simple $$g_k(x)=\sum_{n=0}^{k} (qx)^n+(p^{k+1}+q^{k+1})\,x^{k+1}+q\big((k+2)p^{k+1}+q^{k+1}\big)\,x^{k+2}+O(x^{k+3})$$ The next term would be more than nasty.