<s>[INST] In how many ways can we roll a red die, a yellow die, and a black die, and get a sum of $9$? I know I can use generating functions. Each of the die has a generating function $x+x^2+x^3+x^4+x^5+x^6$, and so I need to find the coefficient of $x^9$ in the generating function of their sum, $(x+x^2+x^3+x^4+x^5+x^6)^3$. I am not sure how to do this, however, short of expanding it all out. 
(I'm not just trying to get the answer but also the method behind it. Thanks a lot.) 
 [/INST] Robert Frost's approach is probably the simplest, but here's a way to do it with generating functions.
We could just multiply it out.  But we can save a bit of work by noticing that $(x + x^2 + x^3 + x^4 + x^5 + x^6)^3 = \left(\frac{x(1 - x^6)}{1 - x}\right)^3 = \frac{x^3 - 3x^9 + 3x^{15} - x^{21}}{(1 - x)^3}$.
We can drop the $x^{15}$ and $x^{21}$ terms because the powers are larger than 9, so we're left with finding the coefficient of $x^9$ in $(x^3 - 3x^9)(1-x)^{-3}$.
That's $\left[x^6\right](1 -  x)^{-3} - 3 \left[x^0\right](1 -  x)^{-3} = \left(\binom{3}{6}\right) - 3 \left(\binom{3}{0}\right) = 25$.
</s>