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.

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*}$$
