Find variables from a multiplication of geometric sequences 
Given $$f(x) = \sum_{i=0}^\infty a_ix^i$$
And $$f(x)(1+2x+2x^2+x^3) = \frac{1}{(1-x)^3}$$
Find the values of $a_0$, $a_1$, and $a_2$.

I try to expand them but it doesn't seem to lead me to any solution.
How can I isolate a0, a1, and a2 to find them?
 A: Tip:
Notice $1+2x+2x^2+x^3=\left(1+x+x^2\right)(1+x)$
Then $$\begin{split}f(x)&=\frac1{(1-x)^3(1+x)\left(1+x+x^2\right)}\\&=\frac1{1-x}\cdot\frac1{(1-x)(1+x)}\cdot\frac1{(1-x)\left(1+x+x^2\right)}\\&=\frac1{1-x}\cdot\frac1{1-x^2}\cdot\frac1{1-x^3}\\&=\left(1+x+x^2+x^3+...\right)\left(1+x^2+x^4+x^6+...\right)\left(1+x^3+x^6+x^9+...\right)\end{split}$$
Then expansion finishes it all. Try it!
A: $f(x)= a_0+a_1x+a_2x^2+O(x^3)$
$f(x)(1+2x+2x^2+x^3)$
$=a_0+(2a_0+a_1)x+(2a_0+2a_1+a_2) x^2
+O(x^3)$
$$\textrm{Again } f(x)(1+2x+2x^2+x^3)=\frac{1}{(1-x)^3}=1+3x+6x^2+O(x^3)$$
Comparing the like powers of x we get:$$a_0=1,a_1=1,a_2=2$$
A: $$f(x)(1+2x+2x^2+x^3) = \frac{1}{(1-x)^3}\implies $$ $$(1-x-x^2+x^4+x^5-x^6)\,f(x)=1$$
Now, let $f(x)=a+b x+c x^2$ and ignore the terms $x^n$ if $n>3$. This gives
$$a+ (b-a)x- (a+b-c)x^2=1$$
Comparing the terms, $a=1$, $b=a=1$, $c=a+b=2$.
A: From the second condition we get
$$f(x) = \frac{1}{(1-x)^3(1+2x+2x^2+x^3)} \tag 1$$
From the first condition we get
$$f(x)=\sum_{i=0}^\infty a_ix^i = a_0 + a_1x+a_2x^2+a_3x^3 + ... \tag 2$$
Hence, $$a_0 = f(0) \overset {(1)}= \dfrac{1}{1\cdot 1} = 1 \tag 3$$
To find $a_1$, differentiate $(2)$
$$f'(x) = a_1 + a_2x + ...$$ Hence, $$a_1 = f'(0)$$ wich you can find from $(1)$
$$f'(x)=-\frac{-3(1-x)^2(1+2x+2x^2+x^3) + (1-x)^3(2+4x+3x^2)}{\text{denominator}^2}$$ which gives $$ a_1 = f'(0) = -\frac{-3+2}{1} = 1$$
Similarly, you can find  $$a_2 = f''(0)$$
A: Also possible as:

Thanks for all of your help guys! :)
