How is long division done on something like this. The log is what I don't understand:

This problem is actually for a discrete math course. The problem says we must find the least n such that f(x) is O(x^n), but for now I'd just like to understand the long division.

Though, an answer and explanation for n, and witnesses C and k would be cool too.