Contour Integral of $\int \frac{a^z}{z^2}\,dz$. 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?
 A: For the case $a \in (0,1)$, as you say, the outer loop to the left of the vertical line of the original integral does not converge.  What you do then is close the loop to the right - in this case, you do not encircle any poles, so the integral over this circuit is zero; therefore, the  integral is zero.
For the case $a > 1$, the pole at $z=0$ is a double pole; the residue is computed as follows:
$$\text{Res}_{z=0} \frac{a^z}{z^2} = \frac{d}{dz} a^z|_{z=0} = \log{a}$$
The issue is that you forgot a factor of $\frac{1}{i 2 \pi}$, which is the definition of the inverse Laplace transform.  
A: 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 


*

*$a^{-R} \to 0$ for $a > 1$, as $R \to \infty$.

*$a^{R} \to 0$ for $a < 1$, as $R \to \infty$.


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.
