Let $C$ the circle $|z|=r$, show that $$\lim_{r\to\infty}\int_{C}{\frac{z^2+2z-5}{(z^2+4)(z^{2}+2z+2)}dz}=0$$
My approach: Note that $|z^2+2z-5|\leq r^2+2r+5$ and $|(z^2+4)(z^{2}+2z+2)|=|(z^2+4)||(z^{2}+2z+2)|\leq (r^2+4)(r^2+2r+2)$. So, $$\left|\frac{z^2+2z-5}{(z^2+4)(z^{2}+2z+2)}\right|\leq \frac{r^2+2r+5}{(r^2+4)(r^2+2r+2)}\to 0$$
When $r\to\infty$.
However, how apply Cauchy's theorem in this case; This theorem is usually formulated for closed paths as follows, let $U$ be an open subset of $\mathbb{C}$ which is simply connected, let $f : U → \mathbb{C}$ be a holomorphic function, and let $\gamma$ be a rectifiable path in $U$ whose start point is equal to its end point. Then $$\int_{\gamma}{f(z)dz}=0$$ I know that, If $f(z)$ is analytic in a bounded region, limited by closed simple curve $C_1,C_2,\ldots, C_n$ and on this curves, then $$\int_{C}{f(z)dz}=\int_{C_{1}}{f(z)dz}+\int_{C_{2}}{f(z)dz}+\ldots+\int_{C_{n}}{f(z)dz}$$ And in this case the singularities points are $\{-1-i,-1+i,-2i,2i\}$, so we can construc curves around this points, can give me any hint, thanks!
The first argument can be easily made to work, we have for $r>10$ the estimations: $$ \begin{aligned} |z^2+2z-5| & \le |z^2|+2|z|+5 \\ &\le(1+2+5)|z|^2\ , \\ |z^2+4| & \ge |z^2|-4 \\ &\ge|z|^2-\frac 4{100}|z^2|=\left(1-\frac 4{100}\right)|z^2|\ , \\ |z^2+2z+2| & \ge |z^2|-2|z|-2 \\ &\ge|z|^2-\frac 2{10}|z^2|-\frac 2{100}|z^2| =\left(1-\frac 2{10}-\frac 2{100}\right)|z^2|\ , \end{aligned} $$ so the whole integrand can be controlled, bounded by a constant times $|z^{-2}|=r^{-2}$. This times the length of the contour, $2\pi r$, tends to zero.
To use the residues, it is enough to observe that the sum of the residues (inside of a circle around zero containing all for poles) is zero. So the integral is zero. (Also after considering the $2\pi i$ from the formula.)
Let us compute the residues.
To makes things easy (to type), i will use a computer algebra system, here sage:
From the above, it is clear that the sum of the residues is zero, the terms in $\pm 7/20$, in $\pm 7i/10$, and in $\pm 17i/10$ cancel together.
We use the above partial fraction decomposition to make the computations easy. The residue of $$ \frac{7 \, z + 17}{10 \, {\left(z^{2} + 4\right)}} = \frac 1{z-2i}\cdot\frac{7 \, z + 17}{10 \, {\left(z+2i\right)}} $$ in $2i$ is the value of the function $$ \frac{7 \, z + 17}{10 \, {\left(z+2i\right)}} $$ in $2i$, we have only to substitute $z=2i$ and compute $\frac{14i+17}{10\cdot(2i+2i)}$ explicitly. We get the above value in the line
Residue of F in 2*I is -17/40*I + 7/20. The residue in $-2i$ is the complex conjugate. (Since the fraction is invariated by the complex conjugation.) Similarly we compute the residues for the other poles and the other fraction in the partial fraction decomposition...