<s>[INST] Using the Maclaurin series for $\frac{1}{1-x}$ to find $\frac{x}{1+x^2}$ Suppose I know the Maclaurin series for $$\frac{1}{1-x}=1+x+x^2+x^3+...= \sum_{n=0}^{\infty}x^n \tag{1}$$
then I can find the Maclaurin series for $\frac{1}{(1-x)^2}$ by the substitution $x\to x(2-x)$, which is obtained by solving the following equation for $x$:
$$1-x=(1-u)^2$$ $$x=u(2-u)$$
and replacing $u$ by and $x$, and $=$ by $\to$ , which leads to
$$\frac{1}{(1-x)^2}=1+x(2-x)+x^2(2-x)^2+x^3(2-x)^3+... \tag{2}$$

Succumbing to the same 'substitution'approach with $\frac{x}{1+x^2}$, I put
$$\frac{1}{1-x}=\frac{u}{1+u^2}$$ $$x=1-\frac{1}{u}-u$$
so with $x \to 1-\frac{1}{x}-x$ 
I should have: 
$$\frac{x}{1+x^2}=1+\left(1-\frac{1}{x}-x\right)+\left(1-\frac{1}{x}-x\right)^2+\left(1-\frac{1}{x}-x\right)^3+...\tag{3}$$
but this does not seem correct (at least according to my Desmos graph for $|x|<1$).
Can someone please explain what my conceptual errors are?
 [/INST] $$\frac{x}{1+x^2}=\frac{1}{1-(\color{red}{1-x-\frac 1x})}$$
$$=\frac{1}{1-u}$$
When $ x \to 0 $, $ u =\color{red}{1-x-\frac 1x} $ goes to $ \infty $, so you are not allowed to repalce $  X $ by $ u $  in the expansion
$$\frac{1}{1-X}=1+X+X^2+..$$
In the first part, $ u=x(2-x)$ goes to zero.
</s>