I am following the following book to study statistics. I have the demostration of the calculation of the variance of the geometric random variable as
$$\begin{align} E(X^2)&=\sum_{k=1}^\infty k^2 q^{k-1}p \\ &=\sum_{k=1}^\infty (k-1+1)^2q^{k-1}p \\ &=\sum_{k=1}^\infty (k-1)^2q^{k-1}p+\sum_{k=1}^\infty 2(k-1)q^{k-1}p+\sum_{k=1}^\infty q^{k-1}p \\ &=\sum_{j=0}^\infty j^2q^{j}p+2\sum_{j=1}^\infty jq^{j}p+1 \qquad \textrm{ Issue 1 here} \\ &=qE[X^2]+2qE[x]+1 \qquad \textrm{Issue 2 here} \\ &\implies E[X^2]=qE[X^2]+2qE[X]+1\\ &\implies pE[X^2]=\frac{2q}{p}+1\\ &\implies E[X^2]=\frac{2q+p}{p^2} \\ &\implies Var[X]=E[X^2]-(E[X])^2=\frac{2q+p}{p^2}-\frac{1}{p^2}=\frac{1-p}{p^2} \end{align}$$
My first issue is as follows: I don't understand why when doing $j=k-1$, one of the sums still starts in 1. My second issue is that $\sum_{i=0}^\infty j^2 q^j p$ should be just $E[X^2]$, I don't get why there is a $q$ in the line of the second Issue.
Firstly, consider the sum $$\sum_{k=1}^{\infty}2(k-1)q^{k-1}p$$ Setting $j = k - 1$, we obtain $$\sum_{j=0}^{\infty}2jq^jp\text{.}$$ However, observe that the first term of this series is $$2(0)q^0p = 0$$ so we can ignore the $j =0$ term and just write $$\sum_{k=1}^{\infty}2(k-1)q^{k-1}p = \sum_{j=0}^{\infty}2jq^jp = \sum_{j=1}^{\infty}2jq^jp\text{.}$$ Secondly, observe that the PMF of $X$ is given by $p_{X}(k) = q^{k-1}p$ for $k = 1, 2, \dots$. Thus $$\sum_{j=1}^{\infty}jq^jp = \sum_{j=1}^{\infty}j(q^{j-1} \cdot q)p = q\sum_{j=1}^{\infty}jq^{j-1}p = q\sum_{j=1}^{\infty}j \cdot p_{X}(j) = q\cdot \mathbb{E}[X] $$