It is given that $r \ne 1,3$ and that the answer is $0 \ \forall r$. I got $0 \ \forall \ r \in(0,1) \cup (3,\infty)$ and $-\pi \ \forall \ r \in(1,3)$. I have 2 solutions:
$$\int_{C[-2i,r]} \frac{dz}{z^2+1} = \frac{-i}{2}\int_{C[-2i,r]} \frac{1}{z-i} - \frac{1}{z+i}dz = \frac{-i}{2}[0-2\pi i] = - \pi$$
$$\int_{C[-2i,r]} \frac{dz}{z^2+1} = \int_{C[-2i,r]} \frac{\frac{1}{z-i}}{z+i} dz = 2\pi i \frac{1}{z-i}|_{z=-i} = 2\pi i \frac{1}{-2i} = - \pi$$
I even computed $-\pi$ on Wolfram Alpha for $r=2$, $r=2.5$ and $r=e$.
And yet the answer is simply $0$
Why is it 0 please?
Note: Textbook has been previously wrong: Is $\int \frac{e^{z^2}}{z^3} dz=\pi i$? I got $2 \pi i$.


You are right and your textbook is wrong: the answer is $-\pi$ if $r\in(1,3)$.