# Reducing a power series to a rational function

I have the series $$\sum_{n=0}^\infty (-1)^n 2n x^{(2n -1)}$$
It turns out that this series is equal to the function $$\frac{-2x}{(1+x^2)^2}$$

Is there a general method that would demonstrate this fact beforehand? I'm looking for an algorithm that expresses a power series as a rational function whenever the power series converges to a rational function.

-

There is no single method for summing all power series. However, there is the sum of a geometric series: $$\sum_{k=0}^\infty x^k=\frac1{1-x}$$ Substitution yields $$\sum_{k=0}^\infty(-1)^kx^{2k}=\frac1{1+x^2}$$ Taking the derivative gives $$\sum_{k=0}^\infty(-1)^k2kx^{2k-1}=\frac{-2x}{(1+x^2)^2}$$