Step 1: General Expansion.
We are given the expression \( (1 + x + x^2 + x^3)^n \). To find the coefficient of \( x^4 \), we can apply the multinomial theorem, which states that:
\[
(a_1 + a_2 + a_3 + \dots)^n = \sum_{i_1 + i_2 + i_3 + \dots = n} \binom{n}{i_1, i_2, \dots} a_1^{i_1} a_2^{i_2} \dots
\]
Here, \( a_1 = 1, a_2 = x, a_3 = x^2, a_4 = x^3 \).
Step 2: Condition for the \( x^4 \) term.
We are looking for the terms where the total power of \( x \) is 4. The powers of \( x \) from each term are \( x^0, x^1, x^2, x^3 \), corresponding to the coefficients \( 1, x, x^2, x^3 \), respectively. We now need to find all the combinations of \( i_1, i_2, i_3, i_4 \) such that:
\[
i_2 + 2i_3 + 3i_4 = 4
\]
where,
\( i_1, i_2, i_3, i_4 \) represent the number of times each term appears.
Step 3: Find possible values of \( i_1, i_2, i_3, i_4 \).
We consider all possible combinations:
- \( i_2 = 4, i_3 = 0, i_4 = 0 \) gives \( x^4 \).
- \( i_2 = 2, i_3 = 1, i_4 = 0 \) gives \( x^4 \).
- \( i_2 = 1, i_3 = 0, i_4 = 1 \) gives \( x^4 \).
Step 4: Apply Multinomial Coefficients.
For each of these cases, we apply the multinomial coefficient to calculate the coefficient of each term:
- For \( i_2 = 4, i_3 = 0, i_4 = 0 \), the coefficient is \( nC4 \).
- For \( i_2 = 2, i_3 = 1, i_4 = 0 \), the coefficient is \( nC4 + rC2 \).
- For \( i_2 = 1, i_3 = 0, i_4 = 1 \), the coefficient is \( nC4 + rC2 + nC4 \cdot nC2 \).
Step 5: Conclusion.
Thus, the coefficient of \( x^4 \) is given by the sum of these terms: \( nC4 + rC2 + nC1 \cdot C2 \), corresponding to option (D).