<s>[INST] extracting a coefficient from formal power series multiplication The Questions is Compute the value of $[x^n] \frac{(1+x)^n}{1-x} $
The solution is as follows:
$[x^n] \frac{(1+x)^n}{1-x} $ = $[x^n](1+x)^n(1 + x + x^2 + x^3 + . . . ) $
=  $\sum_{k=0}^n [x^k](1+x)^n * [x^{n-k}](1 + x + x^2 + x^3 + . . . ) $ 
=  $\sum_{k=0}^n {n \choose k}(1)$
= $2^n $
Could someone please explain how this sum is formed?
 [/INST] $\begin{array}\\
S(n)
&=[x^n] \frac{(1+x)^n}{1-x}
\qquad\text{want coefficient of }x^n\\
&=[x^n](1+x)^n\sum_{m=0}^{\infty} x^m
\qquad\text{expand } \dfrac1{1-x}\\
&=\sum_{k=0}^n [x^k](1+x)^n  [x^{n-k}]\sum_{m=0}^{\infty} x^m
\qquad\text{for each }0\le k \le n
\text{ look at separate terms in the product}\\
&=\sum_{k=0}^n \binom{n}{k}\cdot 1 
\qquad [x^k](1+x)^n=\binom{n}{k},  [x^{n-k}]\sum_{m=0}^{\infty} x^m=1\\
&=2^n
\qquad \sum_{k=0}^n \binom{n}{k}=2^n\\
\end{array}
$
</s>