Compute the difference \[ \int_{|z|=3}\frac{e^{\pi/z}}{z^2+4}\,dz- \int_{|z|=1}\frac{e^{\pi/z}}{z^2+4}\,dz, \] where both integrals are taken counterclockwise.
Solution
Set \[ f(z)\coloneqq\frac{e^{\pi/z}}{z^2+4}. \]
1. In the annulus\[ 1<\abs{z}<3, \]the only singularities of \(f\) are the simple poles \(z=2i\) and \(z=-2i\).
The factor \(e^{\pi/z}\) is holomorphic away from \(z=0\), which lies inside the inner circle and hence outside the annulus. Also \[ z^2+4=(z-2i)(z+2i), \] so the only zeros of the denominator are \(\pm2i\), both of modulus \(2\) and both simple.
2. The required difference equals\[ 2\pi i\left( \operatorname{Res}_{z=2i}f + \operatorname{Res}_{z=-2i}f \right). \]
Apply the residue theorem to the annulus \(1<\abs{z}<3\). Its positively oriented boundary consists of the outer circle \(\abs{z}=3\) counterclockwise and the inner circle \(\abs{z}=1\) clockwise. Thus the boundary integral is exactly the stated outer counterclockwise integral minus the stated inner counterclockwise integral. Step 1 identifies the poles in the annulus.
3. One has\[ \operatorname{Res}_{z=2i}f=-\frac14. \]
Since \(2i\) is a simple zero of \(z^2+4\), \[ \begin{aligned} \operatorname{Res}_{z=2i}f &= \frac{e^{\pi/(2i)}}{2(2i)}\\ &= \frac{e^{-i\pi/2}}{4i}\\ &= \frac{-i}{4i} = -\frac14. \end{aligned} \]
4. One has\[ \operatorname{Res}_{z=-2i}f=-\frac14. \]
Similarly, \[ \begin{aligned} \operatorname{Res}_{z=-2i}f &= \frac{e^{\pi/(-2i)}}{2(-2i)}\\ &= \frac{e^{i\pi/2}}{-4i}\\ &= \frac{i}{-4i} = -\frac14. \end{aligned} \]
5. Therefore the required difference is\[ \boxed{-\pi i}. \]
Substitute steps 3 and 4 into step 2: \[ 2\pi i\left(-\frac14-\frac14\right) = -\pi i. \]
6. Q.E.D.
Step 5 is the requested value.