Evaluate $\displaystyle \int_{|z-i|=R}\frac{z^{4}+z^{2}+1}{z(z^{2}+1)}dz$ as a function of $R>0$ I need to evaluate the integral $\displaystyle \int_{|z-i|=R}\frac{z^{4}+z^{2}+1}{z(z^{2}+1)} dz$ as a function of $R>0$. I may omit values of $R$ for which the denominator turns to $0$.
Now, using partial fraction decomposition, the integral can be split up as follows: $\displaystyle \int_{|z-i|=R} z \,dz + \int_{|z-i|=R}\frac{1}{z}\,dz-\frac{1}{2}\int_{|z-i|=R}\frac{1}{z+i}\,dz -\frac{1}{2}\int_{|z-i|=R} \frac{1}{z-i}\,dz$
Values for which the denominator of the non-decomposed function turns to $0$ include $R=1$ (when $R=1$, the curve intersects the singularity $z=0$) and $R=2$ (when $R=2$, the curve intersects the singularity $z=-i$). 
Also, as $R$ grows to encompass all the singularities, the integral will go to $0$, by Cauchy's Theorem. 
However, I am not really sure what to do with this problem. I tried actually parametrizing each integral, letting $|z-i|=R$ become $z = Re^{i \theta} + i$, but for the second and third integrals, I wound up getting $\ln|0|$, which is undefined. Anyway, this is not evaluating the integral as a function of $R$, but as a function of $z$ (or $\theta$).
Please help! Any help is needed, but any answers cannot use Residues or Cauchy's Integral Formula (Cauchy's Theorem for either simply or multiply connected domains is fine). And I would prefer something completely worked out. Thank you.
 A: You were on the right track using the parameterization $z=i+Re^{i\theta}$, $\theta\in[0,2\pi]$. Here we present a way forward that uses real analysis by evaluating the real and imaginary parts of the integrals separately.  We will evaluate the integral $I$ given by
$$I=\oint_{|z-i|=R}\frac{1}{z(z^2+1)}\,dz$$
and leave the evaluation of the original integral as an exercise.

FIRST INTEGRAL
For the first integral, we have
$$\begin{align}
\oint_{|z-i|=R}\frac1z\,dz&=\int_0^{2\pi}\frac{iRe^{i\theta}}{i+Re^{i\theta}}\,d\theta\\\\
&=\int_0^{2\pi}\frac{R\cos(\theta)+iR(R+\sin(\theta))}{1+R^2+2R\sin(\theta)}\,d\theta\\\\
&=\left.\left(\frac12\log(1+R^2+2R\sin(\theta))  \right)\right|_{0}^{2\pi}+i\int_0^{2\pi}\frac{R(R+\sin(\theta))}{1+R^2+2R\sin(\theta)}\,d\theta\\\\
&=0+i 2\int_0^{\pi/2}\left(\frac{R(R+\sin(\theta))}{1+R^2+2R\sin(\theta)}+\frac{R(R-\sin(\theta))}{1+R^2-2R\sin(\theta)}\right)\,d\theta\\\\
&=i2\, \left.\arctan\left(\frac{1+R\sin(\theta)}{R\cos(\theta)}\right)\right|_{0}^{\pi/2}+i2\, \left.\arctan\left(\frac{1-R\sin(\theta)}{R\cos(\theta)}\right)\right|_{0}^{\pi/2}\\\\
&=i2\,\left(\frac{\pi}{2}-0\right)+i2\,\left(\frac{\pi}{2} \,\text{sgn}(1-R)-0\right)\\\\
&=\begin{cases}
0&,R<1\\\\
i2\pi&,R>1
\end{cases}
\end{align}$$

SECOND INTEGRAL
For the second integral, we have
$$\begin{align}
\oint_{|z-i|=R}\frac1{z+i}\,dz&=\int_0^{2\pi}\frac{2R\cos(\theta)+iR(R+2\sin(\theta))}{4+R^2+4R\sin(\theta)}\,d\theta\\\\
&=\left.\left(\frac12\log(4+R^2+4R\sin(\theta))  \right)\right|_{0}^{2\pi}\\\\
&+i2\, \left.\arctan\left(\frac{2+R\sin(\theta)}{R\cos(\theta)}\right)\right|_{0}^{\pi/2}+i2\, \left.\arctan\left(\frac{2-R\sin(\theta)}{R\cos(\theta)}\right)\right|_{0}^{\pi/2}\\\\
&=i2\,\left(\frac{\pi}{2}-0\right)+i2\,\left(\frac{\pi}{2} \,\text{sgn}(2-R)-0\right)\\\\
&=\begin{cases}
0&,R<2\\\\
i2\pi&,R>2
\end{cases}
\end{align}$$

THIRD INTEGRAL
For the third integral, we have
$$\begin{align}
\oint_{|z-i|=R}\frac1{z-i}\,dz&=\int_0^{2\pi}\frac{iRe^{i\theta}}{Re^{i\theta}}\,d\theta\\\\
&=i2\pi
\end{align}$$

Putting it all together, we have
$$\oint_{|z-i|+R}\frac{1}{z(z^2+1)}\,dz=
\begin{cases}
i2\pi &,R<1\\\\
i\pi&1<R<2\\\\
0&R>2
\end{cases}$$
A: The first integral, $\int zdz = 0$ so we can ignore it
For the rest, use the fact that the winding number of a closed curve $C$ around $a$ is given by $\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z-a}$  
Let $C$ be the circle $ |z-i| = R$ and $I$ be the integral we are calculating
For $R \gt 0$ we have $$\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z-i} = 1 \implies \int_C \frac{dz}{z-i} = 2\pi i$$ 
For $R \lt 1$ we have $$\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z} = 0$$
$$\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z+i} = 0$$
Therefore, for $R \lt 1$ we have $I = -\pi i$  
For $1 \lt R \lt 2$ we have $$\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z} = 1 \implies \int_C \frac{dz}{z} = 2\pi i$$
$$\displaystyle \frac{1}{2\pi i} \int_C \frac{dz}{z+i} = 0$$
Therefore, for $1 \lt R \lt 2$ we have $I = 2\pi i -\pi i = \pi i$  
For $R \gt 2$ we have $$\displaystyle  \int_C \frac{dz}{z} = 2\pi i$$
$$\displaystyle  \int_C \frac{dz}{z+i} = 2\pi i$$
Therefore, for $R \gt 2$ we have $I = 2\pi i -\pi i -\pi i = 0$
