We are asked to find the coefficient of \(x^5\) in the expansion of \((3 + x + x^2)^6\).
Step 1: Apply the Multinomial Theorem
The expansion of \((a + b + c)^n\) is given by the multinomial expansion:
\[
(a + b + c)^n = \sum_{i+j+k=n} \binom{n}{i,j,k} a^i b^j c^k
\]
In our case, the expression is \((3 + x + x^2)^6\), so we have \(a = 3\), \(b = x\), and \(c = x^2\).
The general term in the expansion will be:
\[
\binom{6}{i,j,k} 3^i x^j (x^2)^k
\]
This simplifies to:
\[
\binom{6}{i,j,k} 3^i x^{j+2k}
\]
Step 2: Find the Values of \(j\) and \(k\) for \(x^5\)
We need the exponent of \(x\) to be 5, so:
\[
j + 2k = 5
\]
We consider the possible values of \(j\) and \(k\) that satisfy this equation:
- If \(k = 2\), then \(j = 1\).
- If \(k = 1\), then \(j = 3\).
- If \(k = 0\), then \(j = 5\).
Step 3: Calculate the Corresponding Coefficients
For each valid pair \((j, k)\), we substitute into the general term and calculate the coefficient:
\begin{itemize}
\item For \(k = 2\), \(j = 1\), the term is:
\[
\binom{6}{3,1,2} 3^3 x^5 = 60 \times 27 x^5 = 1620 x^5
\]
\item For \(k = 1\), \(j = 3\), the term is:
\[
\binom{6}{2,3,1} 3^2 x^5 = 60 \times 9 x^5 = 540 x^5
\]
\item For \(k = 0\), \(j = 5\), the term is:
\[
\binom{6}{1,5,0} 3^1 x^5 = 6 \times 3 x^5 = 18 x^5
\]
\end{itemize}
Step 4: Total Coefficient of \(x^5\)
The total coefficient of \(x^5\) is the sum of the coefficients from each valid term:
\[
1620 + 540 + 18 = 2178
\]
Thus, the coefficient of \(x^5\) is \(2178\).