First, let's ask what "Big O" means? Big O is a function designed to mirror the growth pattern of the function, so we can compare it to other functions with comparable growth patterns. We do this because we want to choose functions with lower Big O to be more efficient, especially when we're dealing with problems that have large n of items, where slower functions can grow very quickly. So, again, it's about finding a function with a comparable growth pattern. With Big O, we take the
dominant term.
We do this because at sufficiently large values of x, the full equation will approach the dominant term.
If you imagine the function:
f(x) = x^2 + 2x
At x=2, the function's value is 8, x^2=4, and 2x=4
At x=10, the function's value is 120, x^2=100 and 2x=20
At x=100, the function's value is 10200, x^2=1000 and 2x=200
At x=10000, the function's value is 100,020,000, x^2=100,000,000 and 2x=20,000
Do you see how the dominant term increases much more quickly than the other term?
So we would say the O(x) = x^2 for this equation, because the equation basically grows at the speed of the dominant portion of the equation. If f(x) was 10x^2 + 2x, O would still be x^2, because even though there's a constant term 10 in front of the equation, at high enough x, it's still growing at a rate comparable to x^2, right? You can graph x^2 versus 10x^2 to see that the functions have very similar growth patterns.
Red = x^2 + 2x
Blue = x^2
Green = 2x
Back to your equation, what would you say is the dominant term?
4x^3 or x^2log(x)?
Purple = 4x^3 + x^2log(x) -- you can't even see purple because it's so close to orange.
Orange = 4x^3
Black = x^2log(x)
At x=10:
4x^3 = 4000
x^2log(X) = 200
At x=1000:
4x^3 = 4,000,000,000
x^2log(x) = 3,000,000
It seems to me like the 4x^3 term is the dominant term and we'd call this equation O(x) = x^3
Before you click the below link, maybe stop to consider how certain types of functions might be dominant over certain other types of functions. For example, which is dominant? 2^x or x^2? Which is dominant? x^5 or x^4? Which is dominant? x^2 or xlog(x)?
Here are some rules for determining dominance:
http://ellard.org/dan/www/Q-97/HTML/root/node7.html