How to find out the partial fraction decomposition form? How to find out the partial fraction decomposition form (or pattern ) of a rational function $\dfrac{P(X)}{Q(x)}$ , for example we know that the partial fraction decomposition form of $$\frac{x^{2}+3x+1}{(x-1)^{2}(x+3)},$$ would be something like this :  $$\frac{A}{x-1}+\frac{B}{(x-1)^{2}}+\frac{C}{x+3}, \qquad A,B,C \in \mathbb{R}$$

but how did we "guess" that pattern ? and how to guess it in general case ?
We are just doing polynomial long division on the numberator, and collecting the remainders.

$\frac {p(x)}{(x+3)(x-1)^2} = \frac {q(x) (x+3)  + r}{(x+3)(x-1)^2} = \frac {r}{(x+3)} + \frac {q(x)+r}{(x-1)^2}$

$r$ will always have degree less than its denominator.  $q(x)$ will have degree less than $p(x).$

Next we do polynomial division to $q(x)+r$ breaking into $\frac {r_2(x-1) + r_3}{(x-1)^2} = \frac {r_2}{x-1} + \frac {r_3}{(x-1)^2}$
Resolve the denominator into factors, break them,and in numerators of each write an arbitrary polynomial expression with degree one less than the denominator. Find it by comparison.