Big $O$ notation and limit superior

asymptoticslimsup-and-liminfreal-analysis

I'm reading the Wikipedia's link for big $O$ https://en.wikipedia.org/wiki/Big_O_notation and it says

[…] both of these definitions can be unified using the limit superior: $$f(x) = O(g(x)) \; \mbox{as} \; x \rightarrow a$$ if $$\limsup_{x \rightarrow a} \left|\frac{f(x)}{g(x)}\right|< \infty.$$

But, why is this so? I mean, why is the limit superior used and not the normal limit?

Best Answer

The definition can be applied in situations where the limit $\lim_{x\to a} |f(x)/g(x)|$ may not exist.

For example, let $a=0$. Suppose $f(x)=\sin (1/x)$ and $g(x)$ is the constant function $1$. We have $|f(x)|\leq g(x)$ for all $x$ and so $f(x)=O(g(x))$ as $x\to 0$. But $$ \lim_{x\to 0} |f(x)/g(x)|=\lim_{x\to 0}|\sin (1/x)| $$ does not exist.

Examples with $a=\infty$ might also be useful since that situation is more common. Something similar to the previous example works: $\sin(x)=O(1)$ as $x\to\infty$, but $\lim_{x\to\infty}|\sin(x)|$ does not exist. Or define $f:\mathbb{R}^+\to \mathbb{R}^+$ such that $f(x)=x^2$ if $x$ is an integer, and $f(x)=0$ otherwise. Then $f(x)=O(x^2)$ (as $x\to\infty$), but $f(x)/x^2$ is the indicator function of the positive integers, and so the limit as $x\to\infty$ does not exist.