Evaluating the complex integral $\int_{|z|=2}^{}\frac{1}{z^2+1}dz$ I tried finding the integral of $\int_{|z|=2}^{}\frac{1}{z^2+1}dz$ but not sure whether it is correct.
$\gamma(t)=2e^{it},t\in[0,2\pi]$

$$\int_{|z|=2}^{}\frac{1}{z^2+1}dz=\int_{0}^{2\pi}\frac{2ie^{it}}{4e^{2it}+1}dt$$

I cannot seem to take it forward from here. Is it possible to use Cauchy's integral formula to get an answer? Thanks
You can use the residue theorem to solve the problem:
$$I:=\int_{\left| z \right| = 2} {\frac{1}{{{z^2} + 1}}dz}  = 2\pi \left[ {\operatorname{Residue} \left( {\frac{1}{{{z^2} + 1}};z = i} \right) + \operatorname{Residue} \left( {\frac{1}{{{z^2} + 1}};z =  - i} \right)} \right].$$
We have
$$\operatorname{Residue} \left( {\frac{1}{{{z^2} + 1}};z = i} \right) = \mathop {\lim }\limits_{z \to i} \left( {z - i} \right)\frac{1}{{{z^2} + 1}} = \mathop {\lim }\limits_{z \to i} \frac{1}{{z + i}} = \frac{1}{{2i}},$$
$$\operatorname{Residue} \left( {\frac{1}{{{z^2} + 1}};z =  - i} \right) = \mathop {\lim }\limits_{z \to  - i} \left( {z + i} \right)\frac{1}{{{z^2} + 1}} = \mathop {\lim }\limits_{z \to  - i} \frac{1}{{z - i}} =  - \frac{1}{{2i}}.$$
So $I=0$.
Enforcing the change of variables $t= \pi+s$ gives 

$$\begin{align}I&amp;= \int_{-\pi}^{\pi}\frac{2ie^{it}}{4e^{2it}+1}\:dt=\int_{0}^{2\pi}\frac{2ie^{-is}e^{-i\pi}}{4e^{-2is}+1}\:ds\\&amp;=-\int_{0}^{2\pi}\frac{2ie^{-is}}{4e^{-2is}+1}\:ds 
\\&amp;= -\int_{0}^{\pi}\frac{2ie^{-is}}{4e^{-2is}+1}\:ds-\int_{\pi}^{2\pi}\frac{2ie^{-is}}{4e^{-2is}+1}\:ds \\&amp;\overset{\color{red}{u=s-2\pi}}{=}-\int_{0}^{\pi}\frac{2ie^{-is}}{4e^{-2is}+1}\:ds-\int_{-\pi}^{0}\frac{2ie^{-iu}}{4e^{-2iu}+1}\:du
\\&amp;=-\int_{-\pi}^{\pi}\frac{2ie^{-is}}{4e^{-2is}+1}\:ds \\&amp;=-I \end{align}$$

Hence $$\color{red}{I= \int_{-\pi}^{\pi}\frac{2ie^{it}}{4e^{2it}+1}\:dt=0}$$