I faced some problem that involves arithmetic over asymptotic functions. These are as follows:Let f(n)= (n), g(n)= O(n) and h(n)= (n). Then [f(n). g(n)] + h(n) is:(a) $(n)$  (b) $O(n)$  (c) $\Theta(n)$  (d) None of theseSolution to this was discussed as follows:Let$n = 5$$f = 6$ so that $f = (n)$ and$g = -6$ so that $g = O(n)$ and$h = 5$ so that $h = (n)$$f.g + h = -36 + 5 = -31 < n  f.g + h = O(n)$Now let, $g = 4$ so that $g = O(n)$ and $f.g + h = 24 + 5 = 29 > n  f.g + h = (n)$Hence option 4 is correct, None of these.Then I came across another problemLet $f(n)=(n),g(n)=(n)$ and $h(n)=(n)$. Then $h(n)+f(n)g(n)= ?$(a) $(n)$  (b) $(n^2)$  (c) $(n)$  (d) $(n^2)$This problem was solved in completely different approach:Using the definitions of notations:$f(n)= (n) c_1.n<=f(n)<=c_2.n$        ... for $n>n_0$$g(n)= (n) c_3.n<=g(n)<=c_4.n$        ... for $n>n_0$$h(n)= (n) h(n)>=c_5.n$        ... for $n>n_0$Using the extended notations forms:$c_1.c_3.n^2<=f(n)g(n)<=c_2.c_4.n^2$        ... for $n>n_0$Taking $c_1,c_3=k_1$ and $c_2.c_4=k_3$$k_1.n^2<=f(n)g(n)<=k_2.n^2$Adding h(n)$k_1.n^2+c_5.n<=h(n)+f(n).g(n)<=k_2.n^2$        ... for $n>n_0$As $n^2>n$ for all $$k_3.n^2<=h(n)+f(n).g(n)<=k_2.n^2$Which simplifies to :$f(n).g(n) + h(n) =(n^2)$Though I am able to appreciate both approaches, this leaves me a lot of confusion. I am not able to confidently apply these methods to each other, nor to other similar problems and reach the correct solution. Are these methods correct? In fact are these questions themselves correct? Is there more straightforward approach to solve such kind of problems?
Arithmetic of asymptotic functions
asymptotics
One way to help understand what's going on conceptually would be to draw a linear graph of what each of these functions mean.So for example, say we're given a problem that tells us:$g_1(n)=\Theta(lg(n))$$g_2(n)=O(n^2)$$g_3(n)=\Omega(n)$we can make a quick sketch of where they could be in relation to each other.With this visual, we can get an idea of possible candidates for these functions.So let's bring it back to one of the questions you had trouble understanding:Let $f(n)=(n), g(n)=(n)$ and $h(n)=(n)$. Then $h(n)+f(n)g(n)=?$We know that $f(n)$ and $g(n)$ are both tightly bounded at $n$, so if you multiply them together, you'll clearly get $\Theta(n^2)$. Now if we also add some function $h(n)$ that we know has a lower bound of $n$, the result must be $\Theta(n^2)+\Omega(n)$ which we can reduce to $\Omega(n^2)$, since an additional $...+\Omega(n)$ factor will be at its lowest value $n$ but there is no bound on how high this function can be (it could be anywhere from $n$ to $n^{1000}$ since there's no telling what an upper bound is), so we can conclude that it's $\Theta(n^2)+n=\Omega(n^2)$