The title states the integral in question.
I have tried arguing that there is no pole in $z=0$ because $$(1-\cos(z))/z^2 \approx (1-1+z^2)/z^2 = 1.$$ Then using the contour of a half circle in the upper half plane and rewriting cosine in terms of complex exponentials and use the residue thm. to get: $-\pi (1-\exp(-at))/a^3$. But this does not seem to be the right answer.
If $z=0$ is a pole of order 2, then I should avoid it in my contour, but I do not know what the contribution to the integral is then.
If it was a simple pole it would contribute with half the residue, but what about a pole of order 2?