How to get this required RHS from the given LHS. $$\sum_{k=0}^n2^kx^{k+2}=\frac{x^2-2^{n+1}x^{n+3}}{1-2x}\tag{1}$$
This was used in a solution to the following question I asked. I couldn't understand the step and hence to understand in detail I put it as a question.
Find the sum of the n terms of the series $2\cdot2^0+3\cdot2^1+4\cdot2^2+\dots$