Power series representation of $ f(x) = \frac{(x+2)^2}{x^2+1} $ I'm trying to find the power series representation of $ f(x) = \frac{(x+2)^2}{x^2+1} $
Here is what I tried:
$$
f(x) = \frac{((x+2)^2}{x^2+1}=(x+2)^2\frac{1}{1-(-x^2)}
$$
$$
\sum_{n=1}^\infty(-x^2)^{n-1}=1-x^2+x^4-x^6+x^8-+...
$$
$$
f(x)=(x+2)^2[1-x^2+x^4-x^6+x^8-+...] =(x+2) -(x+2)x^2+(x+2)x^4-(x+2)x^6+(x+2)x^8-+...
$$
I'm not sure if this is correct.

I think it's better to write 
$$f(x) = \frac{(x+2)^2}{x^2+1}=\frac{x^2+4x+4}{x^2+1}=1+\frac{4x+3}{x^2+1}=1+(4x+3) (1-x^2+x^4-x^6+x^8+\cdots)=4+4x-3x^2-4x^3+\cdots$$
