If the numerator $P(x)$ has degree greater than or equal to the
degree of the denominator $Q(x)$, then the rational function
$\displaystyle\frac{P(x)}{Q(x)}$ is called improper.
In this case, we use long division of
polynomials 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 the degree of the $R(x)$ is less than the degree of $Q(x)$ as
a result of the long division. We have

$$\frac{P(x)}{Q(x)} = S(x) + \frac{R(x)}{Q(x)}$$

Integrating $S(x)$ is easy, since it's a polynomial, and we can
use partial fractions on the proper
rational function $\displaystyle\frac{R(x)}{Q(x)}$.

This long division of polynomials and the subsequent partial
fraction decomposition and integration is explained in the
following video.