I came across the following integral in a book (Kato's Perturbation Theory for Linear Operators, $\S$3.5):
where $n$ is a non-negative integer and $a$ is a non-negative real number.
According to WolframAlpha and the book, the answer is
I tried converting it into a contour integral (a semi-circle in the upper half-plane) and using the residue theorem, but my answer did not come out correctly. I'm wondering whether I made a calculation error, or whether I'm doing it fundamentally wrong.