I have this generating function $$(1+x+x^2)^3*(1+x)^3$$ and i try to find $x^6$ and $x^9$ so i tried to simplify the 1st part $(1+x+x^2)^3$= $(1-x^3)^3*(1-x)^-3$ and it gives me $1+$$\frac{3!}{1!2!}x+\frac{4!}{2!2!}x^2+...+\frac{8!}{2!6!}x^6$ multiplied $1-$$\frac{3!}{1!2!}x^3+\frac{3!}{2!1!}x^6+\frac{3!}{3!0!}x^9$ and $(1+x)^3$ = $1+3x+3x^2+x^3$ so i multiply those 3? and then?
what if i want $\frac{x^9}{9!}$? Can you give me a detailed explanation.
by multinomial theoram
$(1+x+x^2)^3=\displaystyle \sum _{b_{1}+2b_{2}\geq0}$$\displaystyle{3\choose{b_{1},b_{2}}}x^{b_{1}+2b_{2}}=1+3x+6x^2+7x^3+6x^4+3x^5+x^6$
also
$(1+x)^3=\displaystyle \sum _{b_{1}\geq0}$$\displaystyle{3\choose{b_{1}}} x^{b_{1}}=1+3x+3x^2+x^3$
so, coeff. of $x^6$ in expansion of $(1+x+x^2)^3 (1+x)^3=1+3.3+6.3+7.1=35$
similarly,
coeff. of $x^9 $ in same expansion is $1.1=1$
without multinomial theoram:
$(1+x+x^2)^3(1+x)^3=[x^6+3(1+x).x^4+3(1+x)^2.x^2+(1+x)^3][(1+x)^3]$
$=[x^6(1+x)^3+3x^4(1+x)^4+3x^2(1+x)^5+(1+x)^6]$
coeff. of $x^6= [1+3.4C_{2}+3.5C_{1}+1]=35$
coeff. of $x^9=1$ (due to first term ) because others sums don't contain powers as high as $x^9$