TITLE: Big Oh notation Question in calculus
QUESTION [8 upvotes]: In my text book, they state the following:
$$\begin{align*}f(x) &= (\frac{1}{x} + \frac{1}{2}) (x-\frac{1}{2}x^2+\frac{1}{3}x^3+O(x^4))-1& ,x \rightarrow 0\\&= 1-\frac{1}{2}x+\frac{1}{3}x^2+\frac{1}{2}x-\frac{1}{4}x^3+O(x^3)-1& ,x \rightarrow 0 \end{align*}$$
However, when I calculate this, I get $1-\frac{1}{2}x+\frac{1}{3}x^2+\frac{1}{2}x-\frac{1}{4}x^3+O(x^3)+\frac{O(x^4)}{2}-1$.
That $O(x^4)$ part disappears I guess, due to the big O notation. However, I cannot figure out why. 
Furthermore, a few pages later, they say that $\lim_{x\rightarrow 0} O(x) = 0$. Which I do not really understand, since $O(x)$ defines a set of functions, no?

REPLY [6 votes]: For your first question, both $O(x^3)$ and $O(x^4)$ are error terms as $x$ approaches zero. Since $x^4$ goes to zero faster than $x^3$ as $x$ goes to zero, the larger error, $O(x^3)$ will subsume the smaller $O(x^4)$.  
For your second question, you're correct in interpreting $O(x)$ as a set of functions. In this context, $O(x)$ is the set of all functions $f(x)$ for which $\mid f(x)\mid \le c\mid x\mid$, eventually, for some $c>0$ (which will depend on $f$). The limit $\lim_{x\rightarrow 0} O(x)$ is then interpreted to mean the limit of all such functions $f(x)$ as $x\rightarrow 0$, if it exists. It does in this case, since every $f\in O(x)$ satisfies $\mid f(x)\mid \le c\mid x\mid$, and so has limiting value $0$ as $x\rightarrow 0$.