This problem is looking like a partial fractions decomposition. However, in order to do that, the degree of the numerator must be strictly less than the degree of the denominator. Hence, the first step would be to perform polynomial long division. Apparently, you get 1 + remainder/denominator. Thus, when you integrate 1, you get the x in the answer. Make sense?

Incidentally, this post belongs in the Calculus forum, even if you're not attending a university.