use little $o$ notation. out from apostol's book. 
$f(x)=o(g(x))$ if $\frac{f}{g}\rightarrow 0$ when $x\rightarrow a$ and gives some properties.
1)$o(g(x))+o(g(x))=o(g(x))$
2)$o(cg(x))=o(g(x))$
3)$f(x).o(g(x))=o(f(x).g(x))$
4)$o(o(g(x)))=o(g(x))$
5)$\frac{1}{1+g(x)}=1-g(x)+o(g(x))$ when $g(x)\rightarrow 0$ when $x\rightarrow a$
we can get another results: 
6)$o(f(x)).o(g(x))=o(o(f(x)).g(x))=o(o(f(x).g(x)))=o(f(x).g(x))$
7)$x^n=o(x^{n-1})$ more general $x^a=o(x^b)$ if $a>b$ 
Give a example. 
Show that $\tan(x)= x+\frac{x^2}{2}+o(x^3)$ when $x\rightarrow 0$.
we have $\cos(x)=1-\frac{x^2}{2}+o(x^3)$ then using $(5)$ with $g(x)= -\frac{x^2}{2}+o(x^3)$ have $\frac{1}{\cos(x)}=\frac{1}{1-\frac{x^2}{2}+o(x^3)}= 1 +\frac{x^2}{2}+o(x^2)$
we have $\sin(x)= x-\frac{x^3}{6}+o(x^4)$ then $\tan(x)=\frac{\sin(x)}{\cos(x)}=(x-\frac{x^3}{6}+o(x^4)).(1 +\frac{x^2}{2}+o(x^2))= x+\frac{x^2}{2}+o(x^3)$.

my question: using $(5)$ with $g(x)= -\frac{x^2}{2}+o(x^3)$ we have $\frac{1}{1-\frac{x^2}{2}+o(x^3)}= 1 -(-\frac{x^2}{2}+o(x^3))+o(-\frac{x^2}{2}+o(x^3))= 1+\frac{x^2}{2}-o(x^3)+o(-\frac{x^2}{2}+o(x^3))$
how he gets to this $-o(x^3)+o(-\frac{x^2}{2}+o(x^3))=o(x^2)$

I'm not sure about this but $\text o(x^3)=\text o(x^2)$ from $(7)$ and, by $(3)$, $$\text o\left(-\dfrac{x^2}{2}+\text o(x^3)\right)=\text o\left(x^2\cdot\left(-\dfrac{1}{2}+\text o(x)\right)\right)=\left(-\dfrac{1}{2}+\text o(x)\right)\cdot\text o(x^2)$$
then the above expression becomes $-\dfrac{1}{2}\text o(x^2)+\text o(x^3)$ and again $\text o(x^3)=\text o(x^2)$ with the fact that $-\dfrac{1}{2}\text o(x^2)=\text o(x^2)$, the last one follows by thinking the left-handed side to be some function which tends to $0$ when divided by $x^2$ and $x\to 0$ which is nothing but $\text o(x^2)$ itself and then combine all of these to obtain what we want.
