## Extending the Binomial Expansion to More Variables

We can general the binomial expansion, in which the coefficient of
$a^xb^{n-x}$
in the expansion of
$(a+b)^n$
is
${}^{n}C_x= \frac{n!}{x!(n-x)!}$
to any number of variables. Suppose we call the variables
$\{ x_1,x_2,...,x_k \}$
. For
$(x_1+x_2+...+x_k)^n$
the coefficient of
$x_1^{m_1}x_2^{m_2}...x_k^{m_k}$
is
$\frac{n!}{(m_1)!(m_2)!...(n_k)!}$
.
Example:
$(p+q+r)^4$

$\frac{4!}{4!0!0!}=1, \; \frac{4!}{3!1!0!}=4{}, \; \frac{4!}{2!2!0!}=1^6, \; \frac{4!}{2!1!1!}=12$
.
All the coefficients are symmetric with respect in interchange of factors in the denominator. The expansion is
\begin{aligned} (p+q+r)^4 & =p^4+q^4+r^4 \\ &+ 4p^3q+4p^3r+4pq^3+4q^3r+4pr^3+4qr^3 \\ &+ 6p^2q^2+6p^2r^2+6q^2r^2 \\ &+12p^2qr+12pq^2r+12pqr^2 \end{aligned}