Order of pole and evaluating residue $f(z)=\frac{ze^{iz}}{z^2+a^2}$
I need to determine the order of the poles and compute the residues.
To compute this, we were told to (in general), write $f(z)=\frac{g(z)}{(z-z_0)^m}$ , and choose $g$ so that $m$ is minimized (a natural number -- this is the order of the pole), my issue is two fold:
1)How do we know, in general, that we have picked a $g$ which minimizes the order.
2) How do I handle this particular function (and others with essential singuarities).
I know I may also write $f(z) =\frac{ze^{iz}}{(z+ia)(z-ia)}$, so I know the singularities are $\frac{+}{ }ia$ and an 'essential singularitiy' (at infinity).  But not sure how to compute the residues....
EDIT:
$\lim_{z\to ∞} \frac{ze^{iz}}{z^2+a^2}=\lim_{z\to ∞} \frac{ze^{iz}}{z^2}=
\lim_{z\to ∞} \frac{e^{iz}}{z}=∞$
So I can't use the result for when the limit exists and is finite (zero or non-zero).  

The practical advice to determine the order of a pole $w$ of a function $f(z)$ is the following: write $f(z)$ in the form \begin{equation} f(z)=\frac{g(z)}{(z-w)^m} \end{equation} where $g(w) \neq 0$, then $m$ is the order of the pole $w$.
In your example, you already have the function $f(z)$ in the nice form, for example for $w=ia$ pick $g(z)=\frac{z e^{iz}}{z+ia}$ which is clearly non-zero when evaluated in $z=ia$, thus the order of the pole $z=ia$ is 1.
By the way, I assumed $a \neq 0$, try to work out on your own what happens when $a=0$.
