For $(1 + x + x^2)^6$, find the term which has $x^6$ in it. 
For $(1 + x + x^2)^6$, find the term which has $x^6$ in it.

I tried to use Newton's binomial formula as:
$$
(1 + x + x^2)^6 = \sum_{k = 0}^{6}\left( \binom{6}{k}(1 + x)^{n-k} x^{2k}\right)
$$
and that's all I can think of, other then just to compute it.

We use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series. This way we can write for instance
\begin{align*}
[x^k](1+x)^n=\binom{n}{k}\tag{1}
\end{align*}

We obtain
\begin{align*}
\color{blue}{[x^6]}&\color{blue}{((1+x)+x^2)^6}\\
&=[x^6]\sum_{k=0}^6\binom{6}{k}x^{2k}(1+x)^{6-k}\tag{2}\\
&=\sum_{k=0}^3\binom{6}{k}[x^{6-2k}](1+x)^{6k-k}\tag{3}\\
&=\sum_{k=0}^3\binom{6}{k}\binom{6-k}{6-2k}\tag{4}\\
&=\binom{6}{0}\binom{6}{6}+\binom{6}{1}\binom{5}{4}+\binom{6}{2}\binom{4}{2}+\binom{6}{3}\binom{3}{0}\\
&=1\cdot1+6\cdot 5+15\cdot 6+20\cdot 1\\
&\,\,\color{blue}{=141}
\end{align*}

Comment:

*

*In (2) we use (1) and apply the binomial theorem.


*In (3) we apply the rule $[x^p]x^qA(x)=[x^{p-q}]A(x)$. We also set the upper limit to $3$ since other indices do not contribute.


*In (4) we select the coefficient of $x^{6-2k}$.
