If the following function is given: $f(n)=n^2+ n \ln(n)+1$. How do you prove the $\Theta$ notation?
I assume that is must be $\Theta$($n^2$). But I'm not sure how to solve it.
If the following function is given: $f(n)=n^2+ n \ln(n)+1$. How do you prove the $\Theta$ notation?
I assume that is must be $\Theta$($n^2$). But I'm not sure how to solve it.
It's clear that
$$n^2\le f(n),\quad \forall n\ge1$$ so $$n^2=\mathcal O(f(n))$$ moreover we have
$$\ln n\le n,\quad \forall n\ge1$$ so $$f(n)\le 3n^2 ,\quad \forall n\ge1$$ and then $$f(n)=\mathcal O(n^2)$$ so we get $$f(n)=\Theta(n^2)$$
You may write, as $n$ tends to $+\infty$, $$ \frac{f(n)}{n^2}=\frac{n^2+ n \ln n +1}{n^2}=1+\frac{\ln n}{n}+\frac{1}{n^2} $$ thus $$ \frac{f(n)}{n^2} \rightarrow 1 $$ then $f(n)=\Theta(n^2)$ moreover $f(n)\sim_{+\infty}n^2.$