$1.$ Prove: If $X_1,X_2,X_3,\ldots,X_n$ are independent random variables then: $$D\left(\sum_{i=1}^n X_i\right)=\sum_{i=1}^n D(X_i)$$
Proof: Because of independence we have:
$$D(\sum_{i=1}^n X_i)=E(\sum_{i=1}^n (X_i-EX_i))^2= \sum_{i=1}^n E(X_i-EX_i)^2+ \sum_{i \neq j} E((X_i-EX_i)(X_j-EX_j))= \sum_{i=1}^n DX_i +**\sum_{i\neq j}(EX_i-EX_i)(EX_j-EX_j)**=\sum_{i=1}^n DX_i$$
What I dont understand is how the expressions within the stars are derived as well as how this independence comes into play here.
$2.$ Find : $EX(X-1)$ if $X=G(p)$- geometric distribution of $p$.
Answer(which I completely don't understand): $$\sum_{k=2}^\infty k(k-1)q^{k-1}p$$
Background of my understanding: I know how to get EX , and I;m aware that the answer here is close to the second derivative of EX.. That is all..