I've been asked to find the residues of the following function;
$$f(z) = \frac{1}{(z^2+1)(z-1)^2}$$
So, I've got that the singularities are $\pm i$ and $1$, with order 1 and 2 respectively.
I was hoping to use the following theorem;
if $f(z)$ can be expressed as $f(z) = \frac{\phi(z)}{(z-z_0)^m}$, with $\phi(z)$ analytic and non-zero at $z_0$, then; $$res_{z \rightarrow z_0} f(z) = \frac{ \phi^{(m-1)}(z_0)}{(m-1)!}$$
So, for the residue at $z = 1$, I can do the following; $$\phi(z) = \frac{1}{(z^2 + 1)}$$ (clearly analytic for z = 1), and then have the following;
$$res_{z \rightarrow 1} f(z) = \frac{ \phi^{(2-1)}(1)}{(2-1)!} = \frac{-2 \times 1}{(1^2 + 1)^2} = \frac{-2}{4} = \frac{-1}{2}$$
So, the residue for $z = 1$ is $\frac{-1}{2}$.
Now, when I try it for the pole at $z = i$, I get the following; $$\phi(z) = \frac{1}{(z-1)^2}$$ (clearly analytic for z = i), and then have the following;
$$res_{z \rightarrow i} f(z) = \frac{ \phi^{(1-1)}(1)}{(1-1)!} = \frac{\phi(i)}{1} = \frac{1}{(i-1)^2} = \frac{i}{2}$$
So, we have the residue at $z = i$ as $\frac{i}{2}$. Using similar working, we can see that the residue at $z = -i$ = $\frac{-i}{2}$.
For verification, I wanted to check my answers using Wolfram; Here
However, in this answer, I apparently get the residues at $z = \pm i$ as $\frac{1}{4}$. I can't really see how this works, and I'm a bit stumped as to where to proceed from here. I can't see anything wrong with my methods - I don't think I've misread my textbook, at least, so I'm a little unsure as to where I went wrong.
Perhaps easier using Cauchy's Residue Theorem
$$\lim_{z\to i}(z-i)f(z)=\lim_{z\to i}\frac1{(z+i)(z-1)^2}=\frac1{2i(1-i)^2}=\frac14$$
and likewise for the other pole in $\;z=-i\;$...
The problem in your development is that in fact
$$\phi(z)=\frac1{(z+i)(z-1)^2}$$
and not what you wrote.