Use generating function to find coefficient Use a generating function to find the coefficient of $x^{22}$ in:
$$\frac{1+3x}{(1-x)^8}$$
I know I need to use a binomial expansion on the lower term, but what about the upper term?

Recall that $$\frac1{1-x}=\sum_{n=0}^\infty x^n.$$
So $$\frac{\mathsf d^7}{\mathsf dx^7}\left[\frac1{1-x}\right] = \frac{7!}{(1-x)^8}$$
and
$$\begin{align*}
\frac{\mathsf d^7}{\mathsf dx^7}\sum_{n=0}^\infty x^n =\sum_{n=7}^\infty \frac{n!}{(n-7)!}x^{n-7}=\sum_{n=0}^\infty\frac{(n+7)!}{n!}x^{n}  
\end{align*}$$
Hence
$$\begin{align*}\frac{1+3x}{(1-x)^8} &= \frac {1+3x}{8!}\frac{\mathsf d^7}{\mathsf dx^7}\left[\frac1{1-x}\right]\\
 &= \frac{1+3x}{7!}\sum_{n=0}^\infty\frac{(n+7)!}{n!}x^n\\
&= \sum_{n=0}^\infty\frac{(n+7)!}{n!7!}x^n + \sum_{n=0}^\infty \frac{3(n+7)!}{n!7!}x^{n+1}\\
&= \sum_{n=0}^\infty\binom {n+7}7 x^n + \sum_{n=1}^\infty 3\binom {n+6}7x^n\\
&= 1 + \sum_{n=1}^\infty \left(\binom{n+7}7+3\binom{n+6}7\right)x^n
\end{align*} $$
So the coefficient of $x^{22}$ is
$$\binom {22+7}{7} + 3\binom{22+6}7 = 5112900.$$
