find the formula of trinomial expansion

Solution 1:

The expansion is given by $$(a+b+c)^n = \sum_{i,j,k} {n \choose i,j,k}\, a^i \, b^j \, c^k $$ where $n$ is a nonnegative integer and the sum is taken over all combinations of nonnegative indices $i, j$, and $k$ such that $i + j + k = n$. The trinomial coefficients are given by $$ {n \choose i,j,k} = \frac{n!}{i!\,j!\,k!} \,.$$ This formula is a special case of the multinomial formula.

Solution 2:

When expanding the product, you pick one of $a,b,c$ from every factor, and get at term $a^ib^jc^k$ where $i+j+k=n$. You can scramble the $n$ factors in $n!$ ways, but as scrambling identical letters makes no difference, the factors are actually repeated $\dfrac{n!}{i!j!k!}$ times.

Hence

$$\sum_{i,j,k\ge0,i+j+k=n}\frac{n!}{i!j!k!}a^ib^jc^k.$$