Why are the coefficients equal in expansions for $(1+x)^{m+n}$ and $(1+x)^m (1+x)^n$? I don't understand a step of a solution:
Let $m,n\in\mathbb{N}$ and $r\in\{1,\dots,m+n\}$ then
$$(1+x)^{n+m}=\left(\sum\limits_{i=0}^m \binom{m}{i}x^i\right)\left(\sum\limits_{j=0}^n \binom{n}{j}x^j\right)\underbrace{=}_{\text{???}}\sum\limits_{r=0}^{m+n}\left(\sum\limits_{k=0}^r \binom{m}{k}\binom{n}{r-k}\right)x^r$$
Can someone explain me the second equality? Thank you.
 A: It’s ordinary polynomial multiplication. Ignoring the detailed nature of the coefficients for a moment, we have
$$\left(\sum_{i=0}^ma_ix^i\right)\left(\sum_{j=0}^nb_jx^n\right)=\left(a_0+a_1x+\ldots+a_mx^m\right)\left(b_0+b_1x+\ldots+b_nx^n\right)\;,$$
the product of polynomials of degrees $m$ and $n$. This, when multiplied out, is a polynomial of degree $m+n$. What’s the coefficient of $x^r$ for $r=0,\ldots,m+n$?
Each term in the uncollected product is of the form $\left(a_ix^i\right)\left(b_jx^j\right)=a_ib_jx^{i+j}$. One of these is an $x^r$ term if and only if $i+j=r$. For each $i\in\{0,1,\ldots,r\}$ there is exactly one $j$ that can be paired with it to give an $x^r$ term: we must have $j=r-i$, and the coefficient of that $x^r$ term is $a_ib_{r-i}$. Thus, the total coefficient of $x^r$ in the product is
$$\sum_{i=0}^ra_ib_{r-i}\;,$$
and the product polynomial is therefore
$$\sum_{r=0}^{m+n}\sum_{i=0}^ra_ib_{r-i}x^r$$
or, with a change of index variables,
$$\sum_{r=0}^{m+n}\sum_{k=0}^ra_kb_{r-k}x^r\;.$$
Now recall that in fact $a_k=\binom{m}k$ and $b_{r-k}=\binom{n}{r-k}$, and you have the desired result.
A: The coefficient of $x^r$ is the number of ways r balls can be chosen out of $m+n$ balls$\left(={{m+n}\choose r}\right)$ . (Sure you understand that!). Now you see $r$ balls can be chosen in the following ways: $0$ from $m$ and $r$ from $n$  or $1$ from $m$ and $r-1$ from $n$ or $2$ from $m$ and $r-2$ from $n$ and so on.. SO basically the total number of ways is their sum . i.e. sum over  all $j$ for ${m\choose j} {n\choose r-j}$
A: It is just the expansion of $(1+x)^{m+n}=\sum{m+n\choose r}x^r$ because $\sum_{k=0}^r{m\choose k}{n\choose r-k}={m+n\choose r}$.
But you can also get it by taking the $x^r$ term of the previous double sum, which is probably what was intended.
