What's the factor of $x^{40} $ in $(1+x^4+x^5)^{100}$? I'm studying this problem but it gets complicated after a few steps, can someone add some feedback between them?
Additional information to the problem: 

Observe that equation $4i + 5j = 40$ has as integer solutions: $(i,j) \in \{ (0,8), (5,4), (10,0) \}$

Steps:
We know that: $$ (s+t)^n = \sum\limits_{r=0}^n {{n}\choose{r}} s^rt^{n-r}$$
For $s = x^5$ and $t = 1+x^4$:
$$(1 + x^4 + x^5)^{100} = \sum\limits_{r=0}^{100} {{100}\choose{r}} x^{5r} (1+x^4)^{100-r} \implies \bigstar $$

This is supposed to be an intermediate step that uses again the first rule for analyzing $(1+x^4)^{100-r}$: 
  $$(1+x^4)^{100-j} = \sum\limits_{\textbf{k=0}}^{\textbf{100-r}} {{100-r}\choose{k}} x^{4k}$$
  I think there is a typo in the presentation and the correct one is:
  $$(1+x^4)^{100-r} = \sum\limits_{\textbf{k=0}}^{\textbf{100-r}} {{100-r}\choose{k}} x^{4k}$$

Using the above we get to:
$$\bigstar \implies (1+x^4+x^5)^{100} = \sum\limits_{\textbf{r=0}}^{\textbf{100}} {{100}\choose{r}} x^{5r} \sum\limits_{\textbf{k=0}}^{\textbf{100-r}} {{100-r}\choose{k}} x^{4k}$$
In order to compute $x^{40}$'s factor we have to choose $k$ and $r$ so that $4k + 5r = 40$, with $k$ and $r$ positive integers less than 100. They are computed for us in the beginning, so the factor of $x^{40}$ is:

$$ {{100}\choose{8}} {{92}\choose{0}} + {{100}\choose{4}}{{96}\choose{5}} + {{100}\choose{0}} {{100}\choose{10}}$$

Question: How do we get the last step? (I know that $C(n,r)$ is the formula to find the factor but this is a little bit more complicated (e.g. the sums have different counters) ).
 A: HINT:
Using Multinomial Series,  $$(1+x^4+x^5)^{100}=\sum_{a+b+c=100}\frac{100!}{a!b!c!}x^{4b+5c}$$ where $a,b,c$ are non-negative integers
A: A good way to understand what's going on here, I think, is to think about you're doing when you expand an expression like $(1+x^4+x^5)^{100}$:  You're taking the $100$-term product
$$(1+x^4+x^5)(1+x^4+x^5)\cdots(1+x^4+x^5)$$
and picking one term from each factor to multiply together, in all $3^{100}$ different ways of picking out one term per factor.  The coefficient of $x^{40}$ is just the number of ways you can do so to get a product with that power of $x$.  As you noted, there are three combinations of $4$s and $5$s that add up to $40$:  ten $4$s and no $5$s, eight $5$s and no $4$s, and five $4$ and four $5$s.  What this really means is that the three cases amount to picking
1) $x^4$ from $10$ of the factors, and $1$ from all the rest
2) $x^5$ from $8$ of the factors, and $1$ from all the rest
3) $x^4$ from $5$ of the factors, $x^5$ from $4$ other factors, and $1$ from all the rest
The first of these can be done in $100\choose10$ ways, the second in $100\choose8$ ways, and the third in ${100\choose5}{95\choose4}$ ways.  So the total number of ways of getting $x^{40}$ is the sum,
$${100\choose10}+{100\choose8}+{100\choose5}{95\choose4}$$
Finally, note that I probably should have looked back at the original posting before writing all this up, in which case I would have written the third case as picking the $4$ $x^5$s first, followed by the $5$ $x^4$s.  But the result is the same, since ${100\choose5}{95\choose4}={100\choose4}{96\choose5}={100!\over4!5!91!}$
A: Use the trinomial expansion $$(1 + x^4 + x^5)^{100} = \sum_{i+j+k=100} {100 \choose i,j,k} x^{4j} x^{5k}.$$
A: To finish the problem using the method shown, you have to find the solutions in nonnegative integers to the equation $4k+5r=40$; and these are given to be $k=0, r=8$ and $k=5, r=4$ and $k=10, r=0$.
Substituting these values into the expression $\binom{100}{r} \binom{100-r}{k}$ and adding the results gives the answer they got.
