How to prove that $n\log n = O(n^2)$?
I think I have the idea but need some help following through.
I start by proving that if $f(n) = n \log n$ then $f(n)$ is a member of $O(n\log n)$. To show this I take a large value $k$ and show that $i\geq k$ and $f(i) \leq c_1\cdot i\log(i)$.
Next I need to show that if $f(n)$ is a member of $O(n \log n)$ then $f(n)$ is a member of $O(n^2)$ by taking a large value $k$ and showing that $i\geq k$ and $f(i) \leq c_2\cdot i\log i$ which turns out to be $f(i)=i^2\log i$ which is a member of $O(n^2)$.
Is that right? Could someone formalize this for me?
From your notation, it looks like we are assuming that $n\in\mathbb{N}$. In fact, I'll be more general and just say $n\in(0,\infty)$.
Then $\log n<n$, since $n < 1+n < e^n$ by its Taylor series.
Thus, $n\log n<n^2$ for all $n\in(0,\infty)$.
As a consequence, $n\log n = O(n^2)$.