Expansion of this expression Let $x$ be a real number in $\left[0,\frac{1}{2}\right].$ It is well known that 
$$\frac{1}{1-x}=\sum_{n=0}^{+\infty} x^n.$$
What is the expansion or the series of the expression $(\frac{1}{1-x})^2$?
Many thanks.
 A: Method 1 : Binomial Theorem for any index
$$(1-x)^{-n}= 1+nx+ \frac{n(n+1)}{2!}x^2+ \frac{n(n+1)(n+2)}{3!}x^3 \dots $$
Putting $n=1$ , we get :
$$\frac{1}{1-x} = 1+x+x^2+x^3+ \dots $$
Putting $n=2$ , we get :
$$\frac{1}{(1-x)^2} = 1+2x+3x^2+4x^3+ \dots $$
Method 2 : Derivatives
Let: $$f(x)=\frac{1}{1-x} = 1+x+x^2+x^3+ \dots $$
Take derivative w.r.t. $x$ both the sides;
$$f'(x)=\frac{1}{(1-x)^2} = 1+2x+3x^2+4x^3+ \dots $$
$$ \implies \frac{1}{(1-x)^2} = 1+2x+3x^2+4x^3+ \dots $$
NOTE : These expansions are valid not only for $ x \in \left[0,\dfrac{1}{2}\right]$ but $\forall ~x \in (-1,1)$
A: By the Cauchy product,
$$\left(\sum_{n=0}^{\infty} x^n\right)^2=\left(\sum_{n=0}^{\infty} x^n\right)\left(\sum_{m=0}^{\infty} x^m\right)=\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}x^nx^m=\sum_{k=0}^{\infty}\sum_{m=0}^k x^k=\sum_{k=0}^{\infty}(k+1)x^k.$$
A: Given that $$\frac{1}{1-x} = \sum_{n=0}^{\infty}x^n$$ for all $x\in(-1,1)$, we may differentiate both sides to obtain
$$\frac{1}{(1-x)^2} = \sum_{n=1}^{\infty}nx^{n-1} = \sum_{n=0}^{\infty}(n+1)x^n$$
for all $x\in(-1,1)$.
Here we have used the fact that a power series is differentiable inside it's interval of convergence, and the derivative can be obtained by differentiating term-by-term, just as you would for a polynomial.
A: Or do by brute force multiplication and gathering terms:
$$\frac{1}{(1-x)^2}=$$
$$
(1+x+x^2+x^3+x^4+\ldots)(1+x+x^2+x^3+x^4+\ldots)\\
=(1+x+x^2+x^3+x^4+\ldots)\\
+x+x^2+x^3+x^4+\ldots\\
\quad +x^2+x^3+x^4+\ldots\\
\quad \quad +x^3+x^4+\ldots\\
=1+2x+3x^2+4x^3+\ldots
$$
A: If you consider $$1+2x+3x^2\ldots \infty,$$ then it is $\dfrac{1}{{(1-x)^2}}$.
Proof: Let $S=1+2x+3x^2\ldots \infty \Rightarrow Sx=x+2x^2+3x^3\ldots\infty$
Now, $S-Sx=1+x+x^2\ldots\infty=\displaystyle\sum_{n=0}^{\infty}x^n=\dfrac{1}{1-x}$
$$S(1-x)=\dfrac{1}{1-x} \Rightarrow S=\dfrac{1}{{(1-x)^2}}.$$
$\therefore$ The series of the expansion is $S=\displaystyle\sum_{n=0}^{\infty}(n+1)x=\dfrac{1}{{(1-x)^2}}$, where $|x|<1$.
This is just the Generating Functions.
