0

How to find the coefficient of $x^4$ in the expansion of $(1+x+x^2)^{20}$?

YuiTo Cheng
  • 4,705

3 Answers3

2

Let us treat this trinomial $$1+x+x^2$$ instead as a binomial: $$=(1+x)+x^2$$ Then, by the binomial theorem, we have $$(1+x+x^2)^{20}=\sum_{n=0}^{20} \binom{20}{n}x^{2n}(1+x)^{20-n}$$ Now notice that it in this sum, only the $n=0,1,2$ terms can have an $x^4$ term, because otherwise the $x^{2n}$ would produce some power of $x$ greater than $4$. Thus we need only to examine the terms $$\binom{20}{0}(1+x)^{20}$$ $$\binom{20}{1}x^2(1+x)^{19}$$ $$\binom{20}{2}x^4(1+x)^{18}$$ Using the binomial theorem, from the first term, we have a coefficient of $$\color{red}{\binom{20}{0}\binom{20}{4}}$$ Again using the binomial theorem, from the second term, we have a coefficient of $$\color{red}{\binom{20}{1}\binom{19}{2}}$$ and from the last term, it is rather obvious that the coefficient will be $$\color{red}{\binom{20}{2}}$$ and so the final coefficient is $$\color{red}{\binom{20}{0}\binom{20}{4}+\binom{20}{1}\binom{19}{2}+\binom{20}{2}}$$

Franklin Pezzuti Dyer
  • 39,754
  • 9
  • 73
  • 166
2

$$ \begin{align} \left[x^n\right]\left(1+x+x^2\right)^{20} &=\left[x^n\right]\left(\frac{1-x^3}{1-x}\right)^{20}\\ &=\left[x^n\right]\overbrace{\sum_{j=0}^{20}\binom{20}{j}\left(-x^3\right)^j}^{\left(1-x^3\right)^{20}}\overbrace{\sum_{k=0}^\infty\binom{-20}{k}(-x)^k\vphantom{\sum_{j=0}^{20}}}^{(1-x)^{-20}}\\ &=(-1)^n\sum_{j=0}^{\lfloor n/3\rfloor}\binom{20}{j}\binom{-20}{n-3j}\tag{$k=n-3j$}\\ &=\sum_{j=0}^{\lfloor n/3\rfloor}(-1)^j\binom{20}{j}\binom{n-3j+19}{19}\\ \end{align} $$ For $n=4$, there are just two term: $$ \binom{20}{0}\binom{23}{19}-\binom{20}{1}\binom{20}{19}=8455 $$

robjohn
  • 345,667
1

HINT

Let $f(x)=(1+x+x^2)^{20}$. Use the forth derivative for $x=0$ , that is $f^{''''}(0)$

If $c$ is the wanted coefficient, then $f^{''''}(x)=4! \cdot c + x \cdot g(x)$. Now making $x=0$ one gets $c = \frac {f^{''''}(0)}{4!}$