I am looking for a general rule to be able to decompose into partial fractions all expressions of the form:
$\frac{P(x)}{Q(x)}$
where $P(x)$ is a polynomial of degree $p$, and $Q(x)$ is a polynomial of degree $q$, such that $p<q$ $\forall$ $\{p, q\} \subset \mathbb{N}$
An attempt at doing this is already available but it is not a general rule, more a collection of cases.
This may be done with residues (as per the Heaviside cover-up method):
$$\frac{P(x)}{Q(x)}=\sum_n\frac{\text{Res}_{x=n}f(x)}{x-n}$$
where $f(x)=\frac{P(x)}{Q(x)}$ and $Q(n)=0$, and $n\in\mathbb C$, provided the roots are distinct.
Beyond that, you may find useful information in Wikipedia.
A quick example of how it works, provided the fraction is in simplified form:
$$\frac{P(x)}{(x-a)(x-b)(x-c)}=\sum_{n\in\{a,b,c\}}\frac{\text{Res}_{x=n}f(x)}{x-n}$$
where
$\text{Res}_{x=a}f(x)=\frac{P(a)}{(a-b)(a-c)}$
$\text{Res}_{x=b}f(x)=\frac{P(b)}{(b-a)(b-c)}$
$\text{Res}_{x=c}f(x)=\frac{P(c)}{(c-a)(c-b)}$