Residue Formula in complex analysis I understand the residue formula but I just can't understand the cancelling down of 
$$ \operatorname{res}_{z=z_1} (f)= \lim \limits_{z \to z_1}(z-z_1) \frac {z^2}{z^4+1} = \frac {z_1^2}{4z_1^3}.$$
If it helps, $ z_1 = e^\frac{\pi i}{4} $.
 A: Since $z^{2}$ is entire, you look for the residues where $z^{4}+1=0$. Your $z_{1}$ is one such solution, there are three others.
A: Lemma:

  
*
  
*Let $f$ have a simple pole at $z_0$, and let $g$ be holomorphic at
  $z_0$. Then $\operatorname{Res}\{f(z)g(z)\colon z=z_0\} =
    g(z_0)\operatorname{Res}\{f(z)\colon z=z_0\}$.
  
*Suppose $f(z_0)=0$ and $f'(z_0)\neq 0$. Then $1/f$ has a simple pole
  at $z_0$ and the residue of $1/f$ is $1/f'(z_0)$.

Proof:

  
*
  
*WLOG suppose $z_0=0$. Let $f=\frac{a_{-1}}{z}+\mathcal{O}(z^n)$ for $n\geq 0$. Let $g(z) = c_0 + c_1z+\cdots$. Then 
  \begin{align}
f(z)g(z)&= \Bigl(\frac{a_{-1}}{z}+\cdots\Bigr)(c_0 + c_1z+\cdots)\\
& = \frac{a_{-1}c_0}{z} + \cdots\\ 
&= g(z_0=0)\operatorname{Res}\{f(z)\colon z=z_0\}
\end{align}
  
*Let $f(z_0)=0$ and derivative not equal to zero. WLOG let $z_0 = 0$. Then $f(z) = 0+a_1z+a_2z^2+\cdots = a_1z(1+k)$ where $k$ is an order of $z$ greater than one. Then
  $$
\frac{1}{f(z)} = \frac{1}{a_1z}+\cdots=\operatorname{Res}(1/f)=\frac{1}{a_1}=\frac{1}{f'(0)}
$$

Let $g(z) = z^2$ and $f(z) = 1/(z^4+1)$. Then $\operatorname{Res}\{g(z)f(z)\colon z=z_0\}$ is by lemma $(1)$ and $(2)$ is
$$
\operatorname{Res}\{g(z)f(z)\} = g(z_0)\frac{1}{f'(z_0)}
$$
