What is the coefficient of x^6 in the expansion (1+x+x^2)^9. Explain please
Count the number of ways to rearrange each of these string.
$\displaystyle 111xxxxxx,~1111xxxxx^2,~ 11111xxx^2x^2,~ \&~111111x^2x^2x^2$
For example: the string $\displaystyle 1111xxxxx^2 $ can be rearranged in $\displaystyle \frac{9!}{(1!)(4!)(4!)}$ ways.
Note that product is $\displaystyle x^6$.
The sum of the numbers of rearrangements is the coefficient of $\displaystyle x^6$.
Another approach is to make use of the identity
$\displaystyle (1+x+x^2)^9 = \left( \frac{1-x^3}{1-x} \right) ^9 = (1-x^3)^9 \; (1-x)^{-9}$
then expand $\displaystyle (1-x^3)^9$ and $\displaystyle (1-x)^{-9}$ by the binomial theorem.
(Assuming you know how to use the binomial theorem for negative exponents.)