1. Find the coefficient of $x^{2}$ in the expansion of $\left(1+x+x^{2}\right)^{9}$.
Solution. Let's set $x+x^{2}=x(1+x)=y$. Then the given expression takes the form $(1+y)^{9}$, and the general term is: $T_{k+1}=\binom{9}{k} y^{k}, 0 \leq k \leq 9$. However, $y^{k}=x^{k}(1+x)^{k}$, so if we denote the general term of the binomial $(1+x)^{k}$ by $L_{m+1}$, we get $L_{m+1}=\binom{k}{m} x^{m}, 0 \leq m \leq k$. Now, the general term of the expansion $\left(1+x+x^{2}\right)^{9}$ is:

$$
T_{k+1}=\binom{9}{k} x^{k}\binom{k}{m} x^{m}=\binom{9}{k}\binom{k}{m} x^{k+m}, 0 \leq k \leq 9,0 \leq m \leq k
$$

Since we are looking for the coefficient of $x^{2}$, it follows that $k+m=2$, so from $0 \leq m \leq k$ we get $0 \leq 2-k \leq k$, i.e., $k \geq 1$ and $k \geq 2$, which is possible for $k=1,2$. The corresponding values for $m$ are obtained from the condition $k+m=2$, i.e., $m=1,0$.

Accordingly, there are two terms in the expansion of the expression $\left(1+x+x^{2}\right)^{9}$ that contain $x^{2}$, and the sum of their coefficients is:

$$
\binom{9}{1}\binom{1}{1}+\binom{9}{2}\binom{2}{0}=45
$$