simplify $(a_1 + a_2 +a_3+... +a_n)^m$ How to simplify this best 
$(a_1 + a_2 +a_3+... +a_n)^m$
for 
$m=n, m<n, m>n$
I could only get 
$\sum_{i=0}^{m}\binom{m}{i}a_i^i\sum_{j=0}^{m-i}\binom{m-i}{j}a_j ... $
 A: The simplification for this type of expansion is done through the multinomial theorem. The multinomial theorem is a generalization of the binomial case to any arbitrary number of terms in the sum to be exponentiated.
The multinomial theorem is written as follows:
$$(x_1 + x_2  + \cdots + x_m)^n 
 = \sum_{k_1+k_2+\cdots+k_m=n} {n \choose k_1, k_2, \ldots, k_m}
  \prod_{1\le t\le m}x_{t}^{k_{t}}\ $$
Where the multinomial co-efficient is defined as:
$$  {n \choose k_1, k_2, \ldots, k_m}
 = \frac{n!}{k_1!\, k_2! \cdots k_m!} $$
It may also be useful to you to note that the multinomial co-efficient is always expressible as products of binomial co-efficients [Graham, Knuth, Patashnik, Concrete Mathematics (2nd edition)]:
$$
{n \choose k_1, k_2, \ldots, k_m} = {x_1+x_2+\cdots+x_m \choose x_2+\cdots+x_m}\cdots{x_{m-1}+x_m \choose x_m}
$$
A fuller explanation can be found on Wikipedia, or Wolfram MathWorld
A: This is called the Multinomial theorem: 
$$(a_1 + a_2 +a_3+... +a_n)^m=\sum_{k_1+k_2+...+k_n=m}\frac{m!}{k_1!\cdot...\cdot k_n!}a_1^{k_1}\cdot...\cdot a_n^{k_n}$$
