<s>[INST] Coefficient of a generating function I have the following generating function, 
$$f(x)=(1+x+x^2+x^3)^4$$
I want to find the $[x^5]$ coefficient, to do so I wrote, 
$$[x^5]f(x)=[x^5](1+x+x^2+x^3)^4=[x^5]\left(\frac{1-x^4}{1-x}\right)^4=
[x^5](1-x^4)^4(1-x)^{-4}
$$
I am wondering how to proceed from here? 
 [/INST] Write the two binomials in terms of series:
$$[x^5](1-x^4)^4(1-x)^{-4}=[x^5]\sum_{i=0}^{4} {4\choose i}(-x^4)^i \cdot \sum_{j=0}^{\infty}{-4\choose j}(-x)^j=\\
[x^5]{4\choose 0}(-x^4)^\color{green}{0}\cdot \color{red}{{-4\choose 5}}(-x)^\color{green}5+{4\choose 1}(-x^\color{green}4)^\color{green}1\cdot \color{blue}{{-4\choose 1}}(-x)^\color{green}1=\\
[x^5]\color{red}{{4+5-1\choose 5}(-1)^5}(-x)^5-4x^4\color{blue}{{4+1-1\choose 1}(-1)^1}(-x)^1=\\
{8\choose 5}-4{4\choose 1}=40,$$
where it was used negative binomial series:
$$(x+a)^{-n} = \sum_{k=0}^{\infty} {-n\choose k}x^ka^{-n-k};\\
{-n\choose k}={n+k-1\choose k}(-1)^k.$$
</s>