# Proving n^2 = O(log n) [duplicate]

This is how I would think it n^2 = O(log n)

f(n) <= c*g(n)

should c=1 ?

n0 = 1

n^2 <= log n

0 <= log n - n^2, for all n>=1

we take n=1 then 0 <= log(1) - 1^2

0 <= 0 - 1

0 <= -1

Therefore n^2 = O(logn) false?

Is this correct?

## marked as duplicate by Raphael♦Feb 17 '18 at 17:50

• No, this is false. As for your attempt, you don't get to set $n=1$; you need to show the inequality for all $n \geq n_0$. – Raphael Feb 17 '18 at 17:50