<s>[INST] Number of solutions in non-negative integers to $x_1 + x_2 + x_3 + x_4 + x_5 = 9$ where $x_1, x_2,x_3,x_4,x_5 \neq 1$ using generating functions Using generating functions, the answer is the coefficient of $x^9$ in the expression $(1+x^2 +x^3 +x^4 \dots)^5$
Since $1+x+x^2+x^3 + \dots = \frac{1}{1-x}$ we get:
$(1+x^2 +x^3 +x^4 \dots)^5 = (\frac{1}{1-x} - x)^5 = (\frac{1 - x + x^2}{1-x})^5 = (\frac{1}{1-x})^5 \cdot (1+x^2-x)^5$
Since we generally have $(\frac{1}{1-x})^n = \sum_{k=0}^n {n+k-1 \choose k}x^k$
We get $(\frac{1}{1-x})^5 = \sum_{k=0}^5 {5+k-1 \choose k}x^k = {4 \choose 0} + {5 \choose 1}x+{6 \choose 2}x^2+{7 \choose 3}x^3+{8 \choose 4}x^4+{9 \choose 5}x^5$
And by the binomial theorem we get $(1+x^2-x)^5 = \sum_{k=0}^5 {5 \choose k}(x^2-x)^k = {5 \choose 0} + {5 \choose 1}(x^2-x) + {5 \choose 2}(x^2-x)^2 + {5 \choose 3}(x^2-x)^3 + {5 \choose 4}(x^2-x)^4 + {5 \choose 5}(x^2-x)^5$
So we are left with calculating the coefficient of $x^9$ in
$({4 \choose 0} + {5 \choose 1}x+{6 \choose 2}x^2+{7 \choose 3}x^3+{8 \choose 4}x^4+{9 \choose 5}x^5) \cdot ({5 \choose 0} + {5 \choose 1}(x^2-x) + {5 \choose 2}(x^2-x)^2 + {5 \choose 3}(x^2-x)^3 + {5 \choose 4}(x^2-x)^4 + {5 \choose 5}(x^2-x)^5)$
The problem is that the $(x^2-x)^k$ parts are really long to compute and it seems like there should be an easier way. Any advice on how to solve this without having to open up these expressions?
 [/INST] Hint: we have to find the coefficient of $x^9$ in $${(1-x)}^{-5}{(x^2-x+1)}^5$$ which can be transformed to by multiplying denominator and numerator by ${(1+x)}^5$ $${(x^3+1)}^5{(1-x^2)}^{-5}$$ or $${(1+5x^3+10x^6+10x^9..)}{(1+5x^2+15x^4+35x^6...)}$$
</s>