What are the steps for deriving a complicated generalization of a partial sum of a taylor series? I looked at the Taylor series for $$-\frac{x}{x-2}$$ and found it to be $$ \sum_{k=1}^{\infty}\frac{x^k}{2^k}$$
but then I also found that this series' partial sum is a bit more complicated in the form of
$$\frac{x 2^{-k}(2^{k}+x^{k})}{x+2} $$
My question is: how was such a partial sum derived, and how would you derive it for something more complicated, like for instance
$$\sum_{k=1}^{\infty}\frac{x^{k^2}}{k!}?$$

In this particular case, the partial sum is easy to find:
$$f(x)=\sum_{k=1}^\infty\frac{x^k}{2^k}\implies \frac{x^n}{2^n}f(x)=\frac{x^n}{2^n}\sum_{k=1}^\infty\frac{x^k}{2^k}=\sum_{k=1}^\infty\frac{x^{k+n}}{2^{k+n}}=\sum_{k=n+1}^\infty\frac{x^k}{2^k}.$$
Then by subtraction,
$$\sum_{k=1}^n\frac{x^k}{2^k}=f(x)\left(1-\frac{x^k}{2^k}\right).$$
