I have an example:

$\displaystyle \frac{1}{(s^2+1)(s+2)^2}=$

$\displaystyle \frac{As+B}{s^2+1}+\frac{C}{(s+2)^2}+\frac{D}{s+2}$

Now, what bothers me here is that i don't understand when to use $\displaystyle As+B$ and when just $\displaystyle A$.

I read that it has something to do with real square roots, but i didn't get it.