If the numerator P(x) has at least as many powers of x as the denominator Q(x), then the rational function P(x)Q(x) is called improper. In this case, we use long division to write the ratio as a polynomial with a remainder.
If dividing P(x) by Q(x) gives S(x) with remainder R(x), then
P(x)Q(x)=S(x)+R(x)Q(x)
Integrating S(x) is easy, since it's a polynomial, and we can use partial fractions on R(x)Q(x).