<s>[INST] What is the coefficient of $x^n$ in the expansion of $(1+x+x^2+x^3+\dots)^4$? I have just come across a question (in a past exam paper for a module that I will be taking soon) which asks what the coefficient of $x^n$ is in the expansion of
$$
(1+x+x^2+x^3+x^4+\dots)^4
$$
Can anyone give me an idea as to how this might be done? Using Wolfram Alpha to expand the brackets and then by inspecting the coefficient of each power manually, I was able to deduce that the coefficient of $n^\text{th}$ term is given by $C(n+2, 3)$. How might I have been able to work this out for myself?
 [/INST] For $-1 < x < 1$, let
$$f(x) = (1+x+x^2+x^3+x^4+\cdots)^4$$
and for each nonnegative integer $n$, let $f^{(n)}(x)$ denote the $n$-th derivative of $f(x)$.

Summing the inner geometric series, we get $f(x) = (1-x)^{-4}$, and by a routine induction, we get
$$f^{(n)}(x)=n!{\small{\binom{n+3}{3}}}(1-x)^{-n-4}$$

Hence, the coefficient of $x^n$ in the power series expansion of $f(x)$ is
$$\frac{f^{(n)}(0)}{n!}=\frac{n!{\large{\binom{n+3}{3}}}(1-0)^{-n-4}}{n!}={\small{\binom{n+3}{3}}}$$

To show the induction . . .

For $n=0$, 
\begin{align*}
f^{(0)}(x)
&=f(x)\\[4pt]
&=(1-x)^{-4}\\[4pt]
&=0!{\small{\binom{0+3}{3}}}(1-x)^{-0-4}\\[4pt]
\end{align*}
so the base case $n=0$ is verified.

Next, assume
$$f^{(n)}(x)=n!{\small{\binom{n+3}{3}}}(1-x)^{-n-4}$$
holds for some nonnegative integer $n$.
\begin{align*}
\text{Then}\;\;f^{(n+1)}(x)&=\frac{d}{dx}\left(n!{\small{\binom{n+3}{3}}}(1-x)^{-n-4}\right)\\[4pt]
&=n!{\small{\binom{n+3}{3}}}(n+4)(1-x)^{-n-5}\\[4pt]
&=n!\left(\frac{(n+3)(n+2)(n+1)}{6}\right)(n+4)(1-x)^{-n-5}\\[4pt]
&=(n+1)!\left(\frac{(n+4)(n+3)(n+2)}{6}\right)(1-x)^{-n-5}\\[4pt]
&=(n+1)!{\small{\binom{n+4}{3}}}(1-x)^{-n-5}\\[4pt]
\end{align*}
which completes the induction.
</s>