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.
 A: Apply the trinomial theorem: $$(1+x+x^2)^6=\sum_{a+b+c=6,\:0\le a,b,c\le 6} \binom{6}{a,b,c}(1)^a(x)^b(x^2)^c$$
To get the $x^6$ term, the possibilities are $(a,b,c)=(3,0,3),(2,2,2),(1,4,1),(0,6,0)$. Hence the $x^6$ term is $$\binom{6}{3,0,3}x^6+\binom{6}{2,2,2}x^6+\binom{6}{1,4,1}x^6+\binom{6}{0,6,0}x^6=141x^6$$
A: You can use recursion:
$P(k)=(1+x+x^2)^k$
$[x^6]P(k)=[x^6]P(k-1)+[x^5]P(k-1)+[x^4]P(k-1)$
where $[x^n]P$ is the coefficient of $x^n$ in $P$.
A: Hint:
You can use the  multinomial formula:
$$(a+b+c)^6=\sum_{\substack{i+j+k=6\\ 0\le i,j, k\le 6}}\frac{6}{i!\,j!\,k!}\,a^i b^j
c^k.$$
Settin  $a=1$, $b=x$, $c=x^2$, you have to determine the solutions in natural numbers of the linear system
\begin{cases}
i+j+k=6 ,\\
j+2k=6.
\end{cases}
A: $$(1 + x+ x^2)^6 = \frac{(1-x^3)^6}{(1-x)^6} = (1-x^3)^6 (1-x)^{-6}$$
We wish to calculate the coefficient of $x^6$. I shall denote $I = (1-x^3)^6$ and $J =(1-x)^{-6}$. We want the coefficient of $x^6$ in $IJ$, denoted as $[IJ]_{6}$. In general, $[P]_k$ denotes the coefficient of $x^k$ in $P$.
Note that $$(1+x)^{-n} = \sum_{k=0}^{\infty} {-n\choose k}x^k = \sum_{k=0}^{\infty} (-1)^k \binom{n+k-1}{k} x^k$$
so,
$$(1-x)^{-6} = \sum_{k=0}^\infty {-6 \choose k} (-x)^k$$
Also,
$$[IJ]_6 = [I]_0 [J]_6 + [I]_1 [J]_5 + [I]_2 [J]_4 + [I]_3 [J]_3 + [I]_4 [J]_2 + [I]_5 [J]_1 + [I]_6 [J]_0$$
and we know that for $0\le k\le 6$, $$[J]_k = {-6\choose k}(-1)^k = {k+5\choose k}$$
and using the binomial theorem $$[I]_k = \begin{cases}0 & k \ne 0,3,6 \\
1 & k =0 \\ -6 & k = 3 \\ 15 & k =6\end{cases}$$
I'll leave the calculations to you.
A: 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}$.
A: Here's a solution sketch: One method would be to use $x^2+x+1=\frac {x^3-1}{x-1}$. Then you can write the expression as $(x^3-1)^6 (x-1)^{-6}$. Expand, separately, $(x^3-1)^6$ and $(x-1)^{-6}$ using the binomial theorem, and see which terms can together make up $x^6$. There would be only $3$ such terms.
A: When you expand the product you get $3^6$ summands, each summand corresponds to whethere $1,x$ or $x^2$ was picked in each of the factors.
Notice that $6$ is the average "degree", so in order to get $x^6$ you need to select the same number of $1$ as $x^2$, and therefore you need to select an even number of $x$. So if we select $x$ $2i$ times we select $1$ $3-i$ times and $x^2$ also $3-i$ times. The number of ways this can be dome is $\binom{6}{2i,3-i,3-i}$.
We can get that the number of ways to do this is $\sum\limits_{i=0}^3 \binom{6}{2i,3-i,3-i}$.
Hence the answer is $\binom{6}{0,3,3} + \binom{6}{2,2,2} + \binom{6}{4,1,1} + \binom{6}{6,0,0} = 20 + 90 + 30 + 1 = 141$
A: When expanding the product $(x^0 + x^1 + x^2)^6$, each term looks like $x^{k_1} x^{k_2} \cdots x^{k_6} = x^{k_1+k_2+\dots+k_6}$ where all $k_i\in \{0,1,2\}$. Hence, the coefficient of $x^6$ in the expansion is the number of six-tuples $(k_1,k_2,\dots,k_6)$ such that $k_1+k_2+\dots+k_6=6$ and all $k_i\in\{0,1,2\}$.
The number of $2$s in such a partition can be $0$, $1$, $2$ or $3$ and for each there is exactly one possible partition up to permuation:
\begin{align}
6 &= 1+1+1+1+1+1 \qquad\text{1 permutation}, \\
  &= 1+1+1+1+2+0 \qquad\text{$\frac{6!}{4!\,1!\,1!}=30$ permutations}, \\
  &= 1+1+2+2+0+0 \qquad\text{$\frac{6!}{2!\,2!\,2!}=90$ permutations}, \\
  &= 2+2+2+0+0+0 \qquad\text{$\frac{6!}{3!\,3!}=20$ permutations.}
\end{align}
Hence, in total there are $141$ summands equal to $x^6$ in the expansion, so the term you are looking for is $141 x^6$.
A: This question might be easier to solve by hand.
However, the general way to solve it is to know that:
$$\frac1{(1-x)^k}=\sum_{n=0}^\infty \binom{n+k-1}{k-1}x^k$$
Then use:
$$x^2+x+1=\frac{1-x^3}{1-x}$$
So:
$$(x^2+x+1)^6 =(1-x^3)^6\frac1{(1-x)^3}$$
So the coefficient of $x^n$ is $$\sum_{k=0}^6(-1)^k\binom 6k\binom{n-3k+5}5$$
This gives, for $n=6,$
$$\binom{11}5-\binom61\binom85 +\binom62\binom55$$
because the other terms are zero.
