Trouble with partial fractions and complex numbers $$f(z) = \frac{3}{(z+1)(z-i)} = \frac{A}{z+1} + \frac{B}{z-i}$$
$$z(A + B) + B - Ai = 3$$
$$A + B = 0$$
$$B-Ai=3$$
Somehow, I end up with $B = - \frac{3}{(1+i)}$
Is that the way to go?
 A: Technically, it will not be the simplest way, just vecause if you have many factors, you'll a system of linear equations which be hard/long to solve.
Especially well suited to the case of simple poles for the fraction, you can remove the denominators, then give $z$  the poles as successive values.
Here is how it runs in the present case: multiplying both sides by $(z+1)(z-i)$, you get
$$3=A(z-i)+B(z+1)$$
Then  setting $z=i$ and $z=-1$ successively, you obtain:
$$\begin{cases}
3=A\cdot 0+B(1+i),&\text{whence}\enspace B=\dfrac{3(1-i)}2,\\[1ex]
3=A(-1-i)+B\cdot 0,&\text{whence}\enspace A=\dfrac{3(-1+i)}2.
\end{cases}$$
A: One practical way to do partial fractions which are of the type $\frac{1}{(x-a)(x-b)}$ is to simply let the answer be $\frac{1}{x-a}-\frac{1}{x-b}$ and adjust the constant term after calculation. In our case we have:
$$\frac{1}{z+1}-\frac{1}{z-i}=\frac{z-i-z-1}{(z+1)(z-i)}\\=-\frac{1+i}{(z+1)(z-i)}$$ from which one directly infers that we must have:
$$\frac{1}{(z+1)(z-i)}=-\frac{1}{1+i}\Big(\frac{1}{z+1}-\frac{1}{z-i}\Big)$$
or that
$$\frac{3}{(z+1)(z-i)}=-\frac{3}{1+i}\Big(\frac{1}{z+1}-\frac{1}{z-i}\Big)$$
This technique is usually much quicker than solving by forming linear equations.
