To find the coefficient of \( x^4 \) in the expansion of \( (1 + x + x^2)^6 \), we can use the multinomial theorem. Here’s a step-by-step solution:
### Step 1: Understand the expression
We need to expand \( (1 + x + x^2)^6 \) and find the coefficient of \( x^4 \).
### Step 2: Use the multinomial expansion
The multinomial expansion states that:
\[
(a_1 + a_2 + a_3)^n = \sum \frac{n!}{k_1! k_2! k_3!} a_1^{k_1} a_2^{k_2} a_3^{k_3}
\]
where \( k_1 + k_2 + k_3 = n \).
In our case, \( a_1 = 1 \), \( a_2 = x \), \( a_3 = x^2 \), and \( n = 6 \).
### Step 3: Determine the combinations for \( x^4 \)
To get \( x^4 \), we can have different combinations of \( x \) and \( x^2 \):
- \( k_1 \): number of times \( 1 \) is chosen
- \( k_2 \): number of times \( x \) is chosen
- \( k_3 \): number of times \( x^2 \) is chosen
The equation we need to satisfy is:
\[
k_2 + 2k_3 = 4
\]
and
\[
k_1 + k_2 + k_3 = 6
\]
### Step 4: Solve the equations
From \( k_1 + k_2 + k_3 = 6 \), we can express \( k_1 \) as:
\[
k_1 = 6 - k_2 - k_3
\]
Substituting into the first equation:
\[
k_2 + 2k_3 = 4
\]
Now we can find possible values for \( k_2 \) and \( k_3 \):
1. If \( k_3 = 0 \):
- \( k_2 = 4 \) and \( k_1 = 2 \) (valid)
2. If \( k_3 = 1 \):
- \( k_2 + 2(1) = 4 \) → \( k_2 = 2 \) and \( k_1 = 3 \) (valid)
3. If \( k_3 = 2 \):
- \( k_2 + 2(2) = 4 \) → \( k_2 = 0 \) and \( k_1 = 4 \) (valid)
### Step 5: Calculate the coefficients
Now we calculate the coefficients for each valid combination:
1. For \( (k_1, k_2, k_3) = (2, 4, 0) \):
\[
\text{Coefficient} = \frac{6!}{2!4!0!} = \frac{720}{2 \cdot 24} = 15
\]
2. For \( (k_1, k_2, k_3) = (3, 2, 1) \):
\[
\text{Coefficient} = \frac{6!}{3!2!1!} = \frac{720}{6 \cdot 2 \cdot 1} = 60
\]
3. For \( (k_1, k_2, k_3) = (4, 0, 2) \):
\[
\text{Coefficient} = \frac{6!}{4!0!2!} = \frac{720}{24 \cdot 2} = 15
\]
### Step 6: Sum the coefficients
Now, we sum all the coefficients obtained:
\[
15 + 60 + 15 = 90
\]
### Final Answer
The coefficient of \( x^4 \) in the expansion of \( (1 + x + x^2)^6 \) is \( \boxed{90} \).