[Math] Proving Big Oh Notation

asymptotics

Show that $f(n) = n^{2} + 2n + 1$ is $O(n^{2})$.

Sorry if this is a duplicate question or anything but I'm terribly having a hard time understanding this big-oh notation. I've looked for methods on proving everywhere but I can't seem to understand this part where the $C$ that I'm looking for translated to another function:

$\frac{f(n)}{g(n)} = \frac{n^{2} + 2n + 1)}{n^{2}} < \frac{n^{2} + 2n^{2} + n^{2}}{n^{2}} = 4$

Best Answer

One has $${|n^2+2n+1|\over n^2}\leq 1+{2\over n}+{1\over n^2}\leq 4\qquad(n\geq1)\ .$$ That's all.

Related Question