In my theoretical CS class we covered Big $O$-notation and I had some problems that needed to be solved.
Show that
$$f(n)=n^3+20n+1=O(n^3)$$ $$l(n)=n^3+20n+1≠O(n^2)$$ $$h(n)=n\sqrt{n}=O(n^2)$$
The rule states that $f(n)\leq C*g(n)$, so for the first question it's
$$n^3+20n+1 \leq C*n^3$$
$$1+\frac {20}{n^2}+\frac {1}{n^3} \leq C$$
As $n$ increases to infinity, the left side approaches $1$. Here's where it's confusing. Since the left side would approach infinity, wouldn't the equation become $1 \leq C$? But the answer says that the answer is $22 \leq C$
For $l(n)$ I did the same thing as above but then it's obvious that no matter what the input of $n$ it will approach infinity and not a constant.
For $h(x)$ I showed that
$$n\sqrt{n} \leq C*n^2$$
$$\frac{n\sqrt{n}}{n^2} = \frac {\sqrt{n}}{n} \leq C$$
As $n$ increases $h(n)$ decreases and eventually approaches $0 $ as $n$ approaches inifity. So how can I show that $n\sqrt{n}=O(n^2)$?
Note that for $$1+\frac {20}{n^2}+\frac {1}{n^3} \leq C$$ the LHS decreases as $n\to\infty$. Since you want the maximum of LHS, you find it when $n=1$, which gives $$C\ge 1+20+1=22$$
Suppose $$l(n)=n^3+20n+1=O(n^2)$$ Then on dividing by $n^2$, we get $$n+\frac{20}n+\frac1{n^2}\le C$$ which is impossible since $\{n\}$ diverges as $n\to\infty$.
Finally we deal with $h(n)$. Write it as $$n^{3/2}=O(n^2)\iff \frac1{\sqrt n}\le C$$ Similarly, since LHS decreases, we need only find it when $n=1$; that is $$C\ge1$$