I based my analysis on the fact that the only residue that's outside the curve is the reside in $\infty$ that's equal to zero, so all the other resides inside the curves must add to zero too.
Am I correct?
I based my analysis on the fact that the only residue that's outside the curve is the reside in $\infty$ that's equal to zero, so all the other resides inside the curves must add to zero too.
Am I correct?
On
Yes (the integral is zero), but not for the reason you think. I don't know of a relation between singularities inside and outside the contour of integration, so I'll do it the old-fashioned way.
Inside $|z|=2$ the integrand $f(z)$ has three singularities: two simple poles at $z=\pm i$ and an essential singularity at $z=0$. A straightforward calculation gives: $$ \text{Res}(f;z=\pm i) = \frac{-1}{2}e^{\mp i} $$ For the singularity at $z=0$, we should appeal to the series expansion: $$ e^{w} =1+w+w^2/2+w^3/6+\cdots;\qquad e^{1/z} = 1 + z^{-1}+z^{-2}/2+z^{-3}/6+\cdots $$ $$ \text{Res}(f;z=0) = \text{Res}\left(\frac{1 + z^{-1}+z^{-2}/2+z^{-3}/6+\cdots}{z(z^2+1)};z=0\right) $$ $$ \text{Res}\left(\left(\sum_{j=0}^{\infty}\frac{z^{-j-1}}{j!}\right)\cdot\left(\sum_{k=0}^{\infty}(-z^2)^k \right);z=0\right) $$Multiplying this out using the Cauchy product gives the residue, i.e. the coefficient of $z^{-1}$, as $$ \sum_{l=0}^{\infty}\frac{(-1)^l}{(2l)!}=\cos(1) $$Then the residue theorem gives $$ \oint_{\left | z \right |=2} \frac{e^{\frac{1}{z}}}{z(z^{2}+1)}\,dz = 2\pi i\left(-\frac{1}{2}e^{- i}-\frac{1}{2}e^{i}+\cos(1)\right)=0 $$
An incomplete attempt at an 'honest' solution:
Put $z=2 e^{i\theta},$ $dz=2i e^{i\theta}$. Then $$\oint_{\left | z \right |=2} \frac{e^{\frac{1}{z}}}{z(z^{2}+1)}\,dz = i\int_0^{2\pi}\frac{ \exp\left(\frac{e^{-i \theta }}{2}\right)}{1+4 e^{2 i \theta }}\,d\theta$$ At this point (ignoring the $i$ out front), one could split the integrand into real and imaginary parts. The real part $R$ of the integrand satisfies $R(\theta)=-R(2\pi -\theta)$, so that integrates to zero. Mathematica claims the imaginary part integrates to zero as well but I can't quite show it.
The substitution $w=1/z$ gives $$\int_{|z|=2}\frac{e^{1/z}}{z(z^2+1)}\,dz=\int_{|w|=1/2}\frac{we^w}{1+w^2}\,dw=0$$ by Cauchy's theorem. This is basically the same as your argument that there are no singularities outside the circle.