confusion regarding 'o' function . could one explain me the following steps ? 
my books have written , 
$$\sec(x) = \frac{1}{1-x^2/2 + o(x^2)} = 1 + x^2/2 + o(x^2)$$ $$\sec^2(x) = \left(1 + x^2/2 + o(x^2)\right)^2 = 1 + x^2 + o(x^2)$$
the the expression for 'sec' from Taylor series expansion I understand. but how can we write , $$ \frac{1}{1-x^2/2 + o(x^2)} = 1 + x^2/2 + o(x^2)$$ 
?
And how do we integrate
$$o(x^2) ?$$
in my books they have written  integrating $$\sec^2(x)$$ we get $$\tan(x) = x + x^3/3 + o(x^3)$$ how do we do such integration ?  

$\frac{1}{1-x^2/2 + o(x^2)} = 1 + x^2/2 + o(x^2)$
$[1-(x^2/2-o(x^2))]^{-1}=1+x^2/2-o(x^2)+(x^2/2-o(x^2))^2+O(f(x))$
Here for sufficiently small "$x$" we can ignore $2nd$ terms and merge $O(f(x))$ with $o(x^2)$ because it will contain terms at least larger than $x^2$.
Gives $1+x^2/2-o(x^2)+O(f(x))=1+x^2/2+o'(x^2)$
