My task is to show $$\int_{c-i\infty}^{c+i\infty}\frac{a^z}{z^2}\,dz=\begin{cases}\log a &:a\geq1\\ 0 &: 0<a<1\end{cases},\qquad c>0.$$So, I formed the contour consisting of a semi-circle of radius $R$ and center $c$ with a vertical line passing through $c$. I am having two problems. I can show that along this outer arc, the integral will go to zero if and only if $\log a\geq0$, or equivalently, $a\geq1$; the problem is that the integral of this contour should be $2\pi i\cdot \text{Res}(f;0)$, so for $a\geq1$, I find $$\int f(z)=2\pi i\log a,\qquad a\geq1.$$My second problem occurs when $0<a<1$, I can no longer get the integral along the arc to go to zero as before.
Am I making a mistake in my first calculation, or is the problem asking to show something that is wrong? For the second case, how do I calculate this integral?
For $a>1$, consider the contour $$(c-iT \to c+iT) \cup (c+iT \to -R +iT) \cup (-R+iT \to -R - iT) \cup (-R-iT \to c-iT),$$where $R>0$.
For $a<1$, consider the contour $$(c-iT \to c+iT) \cup (c+iT \to R +iT) \cup (R+iT \to R - iT) \cup (R-iT \to c-iT),$$where $R>0$.
Then let $R \to \infty$ and then $T \to \infty$.
The main reason for choice of these contours is that
For $a>1$, the contour encloses a pole of the integrand at $z=0$ and hence this contribution will be reflected in the integral $\left( \text{recall that }a^z = 1 + z \color{red}{\log(a)} + \dfrac{z^2 \log^2(a)}{2!} + \cdots \right)$, whereas for $a<1$, the integrand is analytic in the region enclosed by the contour.