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?
 A: Recall that
$$1+x^2+\cdots =\frac{1}{1-x},$$
hence you are looking for $\frac{1}{(1-x)^4}$ So, you have a partition of $n$ in $4$ parts, where the order matters, say $x_1+x_2+x_3+x_4=n$ and such that $x_i\geq 0.$  What if you take $n$ and write it as $$n=\underbrace{1+\cdots +1}_{n\text{ times}}$$ because you have $4$ summands, then you need to put, in between them $3$ additions the problem is that the parts can be $0$ hence you can repeat so, for a moment, lets think that $x_i\geq 1$ and then we fix the argument. If that happens, then from the $n-1$ slots(notice that in between $n$ ones there are $n-1$ empty spaces), you have to choose $3$ of those, for a total of $\binom{n-1}{3}.$ To solve the problem of the zero, what if you add and subtract $4$?? You will get something like $\binom{n-1+4}{3}$
A: $$\begin{align}(1+x+x^2+\cdots)^4
&=\frac1{(1-x)^4}
\\&=\frac16\frac{d^3}{dx^3}\frac1{(1-x)}
\\&=\frac16\sum_{n\geq0}\frac{d^3}{dx^3}x^n
\\&=\frac16\sum_{n\geq3}n(n-1)(n-2)x^{n-3}
\\&=\sum_{n\geq0}\frac{(n+1)(n+2)(n+3)}6x^n
\end{align}$$
A: Hint: Assuming $|x| < 1$ so that the series converges absolutely, all rearrengements are valid. Then write $u(x) = x^{n + 1} + x^{n + 2} + \ldots$ You are interested in $(1 + x + \ldots + x^n + u(x))^4,$ which you can develop using Newtown's multinomial expansion and observing that everything with a factor of $u(x)$ will be discarded.
A: Combinatoric Approach
Suppose that we pick $x^a$ from the first factor of $\left(1+x+x^2+x^3+\cdots\right)$, $x^b$ from the second, $x^c$ from the third, and $x^d$ from the fourth. Therefore, we need to count how many ways we can choose $a,b,c,d\ge0$ so that $a+b+c+d=n$ to count how many terms we get whose product is $x^n$.
To do this, we can use Stars and Bars ($3$ bars and $n$ stars).

Binomial Theorem
$$
\begin{align}
\left(1+x+x^2+x^3+\cdots\right)^4
&=(1-x)^{-4}\\
&=\sum_{n=0}^\infty\binom{-4}{n}(-x)^n\\
&=\sum_{n=0}^\infty\binom{n+3}{3}x^n\\
\end{align}
$$
since $\binom{-4}{n}=(-1)^n\binom{n+3}{n}=(-1)^n\binom{n+3}{3}$ as shown in this answer.
A: Hint: compute the third derivative of the expansion 
$$\frac{1}{1-x}=1+x+x^2+x^3+\dots$$
A: 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.
A: Let $(1+x+x^2+..)^4=a_0+a_1x+a_2x^2+...$. Since $1+x+x^2+..=1/(1-x)$, we have $(a_0+a_1x+a_2x^2+...)(1-x)^4=1$.
Hence $(a_0+a_1x+a_2x^2+...)(1-4x+6x^2-4x^3+x^4)=1$. 
By comparing coeffiient, we get:
$a_0=1,a_1-4a_0=0,a_2-4a_1+6a_0=0,a_3-4a_2+6a_1-4a_0=0$ and $a_n-4a_{n-1}+6a_{n-2}-4a_{n-3}+a_{n-4}=0$ for all $n\ge 4$. You can show the $a_n$ have desired form by induction.
