Cauchy integral problem

39 Views Asked by At

Cauchy's integral formula states that if $f$ is holomorphic inside and on a positively contour $\gamma$, then if $a$ is inside $\gamma$ we have: $$ \tag{1} f(a)=\frac{1}{2 \pi i} \int_{\gamma} \frac{f(w)}{w-a} d w $$ Consider $\gamma=\gamma(0 ; 2)$ and $$\tag{2} \int_{\gamma} \frac{\sin z}{z^{2}+1} \mathrm{~d} z $$ We can rewrite this integral as $$\tag{3} \int_{\gamma} \frac{\sin z}{(z+i)(z-i)} d z $$ and identify $f(z)=\frac{\sin{z}}{1+i}, a=i$. We then get using eq. $(1)$ $$\tag{4} \int_{\gamma} \frac{\sin z}{z^{2}+1} \mathrm{~d} z=2\pi i\cdot\frac{\sin{i}}{2i}=i\pi \sinh{1} $$ However, if I do the integral in Mathematica I get a result of $2\pi i \sinh{1}$, i.e., a factor of $2$ larger. Did I make a mistake when using the integral formula?