Partial fraction decomposition of type $1/(x^2+k)$ 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?

Decomposing $1/(x+n)(x^2 + k)$ is only difficult (for me) when k is a positive quantity. Otherwise just use $a^2 - b^2$. For example:
$$\frac1{(x-3)(x^2-1)} = \frac1{(x-3)(x-1)(x+1)} = \frac{A}{x-3} + \frac{B}{x-1} + \frac{C}{x+1}$$
Here,
$$A = \frac1{(3-1)(3+1)} = \frac1{8}\\
B = \frac1{(1-3)(1+1)} =\frac{-1}{4} \\
C = \frac1{(-1-3)(-1-1)} = \frac{1}{8}$$

Now, for the guy I don't like:
$$\frac{1}{(x^2 +1)(x-3)} = \frac{Ax+B}{x^2 +1} + \frac{C}{x-3}$$

Try some easy values of $x$, I'll take $x=0$,
$$ B + \frac{C}{3} = \frac{-1}{3} \quad\dots(1)$$
Now, I'll take $x= 1$,
$$\frac{A + B}{2} - \frac{C}{2} = -\frac{1}{4} \quad\dots(2)$$
Let $x=2$,
$$\frac{2A + B}{5} - C= -\frac1{5}\quad\dots(3)$$ 
Solving $(1)$ and $(2)$ and $(3)$, we get
$$A = -\frac{1}{10},\, B = -\frac{3}{10},\, C = \frac{1}{10} $$ 

This is the easiest (and only) method I know to find partial fractions and it helps me immensely in indefinite integration.
