How to evaluate the following complex integral I'm asked to evaluate the following complex integral
$$\oint_{C}^{}{\frac{z}{z^2+a^2}dz}\quad |a|<1$$
where C is the unit circle enclosing the origin.
The integrand loses analyticity when $z = \pm ia$, each of which lies interior to C.
However, we can utilize deformation of the contour and Cauchy's Theorem where $C=C_0-C_1-C_2=0$. Therefore we now need to evaluate
$$\oint_{C_1}^{}{\frac{z}{z^2+a^2}dz} + \oint_{C_2}^{}{\frac{z}{z^2+a^2}dz}\quad |a|<1$$
However, I don't know how to evaluate the above integrals, and would love some advice on how to do so.
 A: METHODOLOGY $1$:
Yet another approach is to use partial fraction expansion and write
$$\frac{z}{z^2+a^2}=\frac12\left(\frac{1}{z-ia}+\frac{1}{z+ia}\right)$$
Then, we have
$$\begin{align}
\int_{|z|=1}\frac{z}{z^2+a^2}\,dz&=\frac12\int_{|z|=1}\left(\frac{1}{z-ia}+\frac{1}{z+ia}\right)\,dz\\\\
&=\frac12 \int_{|z|=1}\frac{1}{z-ia}\,dz+\frac12 \int_{|z|=1}\frac{1}{z+ia}\,dz\\\\
&=\frac12 \left(2\pi i+2\pi i\right)\\\\
&=2\pi i
\end{align}$$

METHODOLOGY $2$:
We can evaluate the integral of interest by evaluating the Residue at Infinity.  Let $f(z)=\frac{z}{z^2+a^2}$, then the residue at infinity of $f$ is given by
$$\begin{align}
\text{Res}\left(f(z),\infty\right)&=-\text{Res}\left(\frac{1}{z^2}f\left(\frac1z\right),0\right)\\\\
&=-\lim_{z\to 0}\left(\frac{1}{a^2z^2+1}\right)\\\\
&=-1
\end{align}$$
Therefore, we find that
$$\begin{align}
\int_{|z|=1}f(z)\,dz&=-2\pi i\, \text{Res}\left(f(z),\infty\right)\\\\
&=2\pi i
\end{align}$$
as expected!
A: Using the factorization given by Daniel in the comments and Cauchy's Integral Theorem the integrals evaluate to
$$2\pi i(\frac{ia}{2ia})+2\pi i(\frac{-ia}{-2ia}) = 2\pi i$$
