<s>[INST] Easy partial fraction decomposition with complex numbers There is an easy method to perform a partial fraction decomposition - described here, under the "Repeated Real Roots" title, for the coefficient A2.
The problem is - this method doesn't work in some cases, for example:
$$
\frac{1}{(2 + j \omega)^2 \, (4 + j \omega)}
 = \frac{A}{2 + j \omega}
 + \frac{B}{(2 + j \omega)^2}
 + \frac{C}{4 + j \omega}
$$
The coefficients B,C get their proper value:
$$
B = \frac{1}{4 + j \omega} \Big|_{\omega=2j} = \frac 12
$$
$$
C = \frac{1}{(2 + j \omega)^2} \Big|_{\omega=4j} = \frac 14
$$
But the coefficient A get a false value:
$$
A = \frac{d}{d \omega} \left( \frac{1}{4 + j \omega} \right)\Big|_{\omega=2j}
 = \frac{-j}{4}
$$
The true/proper value for A is $-\frac 14$.
I wonder what is the general formula for this kind of elegant/quick/easy trick to find the coefficients during partial fraction decomposition?
 [/INST] The partial fraction expansion is
$$\frac{1}{(2+j\omega)^2(4+j\omega)}=\frac{A}{2+j\omega}+\frac{B}{(2+j\omega)^2}+\frac{C}{4+j\omega}\tag 1$$
To find $C$, we multiply both sides of $(1)$ by $4+j\omega$ and take the limit as $j\omega \to -4$.  Proceeding, we find 
$$\begin{align}
\lim_{j\omega \to -4}\frac{(4+j\omega)}{(2+j\omega)^2(4+j\omega)}&=\frac14\\\\
&=\lim_{j\omega \to -4}\left(\frac{A(4+j\omega)}{2+j\omega}+\frac{B(4+j\omega)}{(2+j\omega)^2}+\frac{C(4+j\omega)}{4+j\omega}\right)\\\\
&=C
\end{align}$$
To find $B$ , we multiply both sides of $(1)$ by $(2+j\omega)^2$ and  take the limit as $j\omega \to -2$.  Proceeding, we find 
$$\begin{align}
\lim_{j\omega \to -2}\frac{(2+j\omega)^2}{(2+j\omega)^2(4+j\omega)}&=\frac12\\\\
&=\lim_{j\omega \to -2}\left(\frac{A(2+j\omega)^2}{2+j\omega}+\frac{B(2+j\omega)^2}{(2+j\omega)^2}+\frac{C(2+j\omega)^2}{4+j\omega}\right)\\\\
&=B
\end{align}$$
To find $A$ , we multiply both sides of $(1)$ by $(2+j\omega)^2$, take a derivative with respect to $j\omega$, and  take the limit as $j\omega \to -2$.  Proceeding, we find 
$$\begin{align}
\lim_{j\omega \to -2}\frac{d}{d(j\omega)}\left(\frac{(2+j\omega)^2}{(2+j\omega)^2(4+j\omega)}\right)&=-\frac14\\\\
&=\lim_{j\omega \to -2}\frac{d}{d(j\omega)}\left(\frac{A(2+j\omega)^2}{2+j\omega}+\frac{B(2+j\omega)^2}{(2+j\omega)^2}+\frac{C(2+j\omega)^2}{4+j\omega}\right)\\\\
&=A
\end{align}$$
</s>