I want to be able to explicitly write it as $a_r = \dots $
When using multinomial theorem, I'm getting stuck at 2 conditions, but I'm not able to simplify from there.
I wrote $(1+x+x^2)^n =\displaystyle \sum_{a,b,c}^{a+b+c=n}\frac{n!}{a!b!c!}(1)^a(x)^b(x^2)^c = \frac{n!}{a!b!c!}x^{b+2c} $
so my conditions are $b+2c=r$ and $a+b+c=n$, how do I proceed from here?
Edit: Since in this particular case, we are able to write $ (1+x+x^2)^n = \displaystyle(\frac{1-x^3}{1-x})^n$, how can we do it for any random multinomial like $(1+3x+7x^2)^n $?
Guide:
One possible way\begin{align} (1+x+x^2)^n &= \left(\frac{1-x^3}{1-x}\right)^n \\ &= (1-x^3)^n (1-x)^{-n} \end{align}
Try to find the expansion for each term.