I know that partial fraction of this can be written as: $$\frac{3x}{(1+x)(2+x)}=\frac{-3}{1+x}+\frac{6}{2+x}$$ Which can be done in these ways: $$\frac{3x}{(1+x)(2+x)}=\frac{A}{1+x}+\frac{B}{2+x}\implies3x=A(2+x)+B(1+x),\forall\;x$$ And now solving it to get A and B.Also someone told me that write the fraction without that denominator whose coeffecient you want to know and put root of denominator, for e.g.: $$\text{coefficient of $1/(1+x)$ i.e. A}=\frac{3x}{2+x}|_{x+1=0\implies x=-1}=\frac{-3}{1}$$ I know that this is just the first way disguised in an easy form, now what when I need to decompose: $$\frac1{(x-3)(x^2-1)}\text{ or }\frac1{(x-3)(x^2+1)}$$ There exist multiple root of first and root to second doesn't exist.
Now what to do, adopt the first method? Is there any easy method for these?