According to wiki we should use Big O notation in the following manner:
$$f(n) = O(g(x))$$
where = is read not as "equals" but "is" instead.
So, it means that if f(n) = n^2 + 2n + 5 we should note it as:
$$n^2 + 2n + 5 = O(n^2)$$
But in some articles I saw that people note it as:
$$O(n^2 + 2n + 5) = O(n^2)$$ instead
So is the latter expression is valid form or we can not note it in that way?
$f(n) = O(g(n))$ means that $\frac{f(n)}{g(n)}$ is bounded, hence $O(n^2 + 2n + 5) = O(2^n)$ is correct. We have more:
$$O(n^2 + 2n + 5) = o(2^n),$$
which means that $\frac{n^2+2n+5}{2^n} \to 0$$
as $ n \to \infty$.