Solution (source code)

= Solution

The <poles> are the four roots of $z^4=-1$. The upper <half-plane> contains $a=e^{i\pi/4}$ and $b=e^{3i\pi/4}$, both enclosed when $R>1$. At a <simple pole> $q$,
$$
\operatorname{Res}\left(\frac{z^2}{z^4+1},q\right)=\frac{q^2}{4q^3}=\frac1{4q}.
$$
The sum of the two <residues> is
$$
\frac14(e^{-i\pi/4}+e^{-3i\pi/4})=-\frac{i}{2\sqrt2}.
$$
The <residue theorem>, with the real segment traversed from $-R$ to $R$ and the upper arc from $R$ to $-R$, yields
$$
\boxed{\oint_{\Gamma_R}\frac{z^2}{z^4+1}\,dz=\frac{\pi}{\sqrt2}.}
$$