Long division of polynomial I am reading a math history book which says:

"Gregory could have learned in Italy that the area under the curve $y=1 / (1+x^2)$, from
  $x=0$ to $x=x$, is arctan x, and a simple long division converts $
1 / (1+x^2)$ to  $1 - x^2 + x^4 - x^6+...$"

Can someone please explain how is
$1/(1+x^2)  = 1 - x^2 + x^4 - x^6+...$
And
How do you perform long divison of this kind?
Thanks.
 A: Knowledge of geometric series tells me that
$$\frac1{1-z}=\sum_{n\ge 0}z^n=1+z+z^2+z^3+\ldots\;;$$
if I now set $z=-x^2$, I find that
$$\frac1{1+x^2}=\sum_{n\ge 0}(-x^2)^n=\sum_{n\ge 0}(-1)^nx^{2n}=1-x^2+x^4-x^6+-\ldots\;.$$
That said, it is possible to do the long division, with a little ingenuity:
$$\begin{align*}
\frac1{1+x^2}&=\frac{(1+x^2)-x^2}{1+x^2}\\
&=1-\frac{x^2}{1+x^2}\\
&=1-\frac{(x^2+x^4)-x^4}{1+x^2}\\
&=1-\frac{x^2(1+x^2)-x^4}{1+x^2}\\
&=1-x^2+\frac{x^4}{1+x^2}\\
&=1-x^2+\frac{(x^4+x^6)-x^6}{1+x^2}\\
&=1-x^2+\frac{x^4(1+x^2)-x^6}{1+x^2}\\
&=1-x^2+x^4-\frac{x^6}{1+x^2}\\
&\;\;\vdots
\end{align*}$$
A: $$(1+x^2)(1-x^2+x^4+\dots)$$
$$=(1-x^2+x^4+\dots)$$
$$+x^2(1-x^2+x^4+\dots)$$
$$=(1-x^2+x^4+\dots)$$
$$+(x^2-x^4+x^6+\dots)$$
$$=1$$
A: Use binomial theorem 
$$(1+x)^n=1+nx+\frac{n(n-1)x^2}{2!}+\frac{n(n-1)(n-2)x^3}{3!}+...$$
Replace x by $x^2 $ and n=-1 
A: This isn't an instance of long division being used. Rather, we know that for every $|r| <1$, the geometric series
$$\sum_{n = 0}^{\infty} r^n = \frac{1}{1-r}$$
Replacing $r = -x^2$ in the expression above yields the desired result (being careful to note that $|x| < 1$ must be true for the equality to hold). 
