Integrals of the following form show up frequently in Physics, especially in electrodynamics. I have the following integral that I have no idea how to approach solving it:
I can solve each of them separately, or look them up in table integrals, but, the caveat is that separately, the integrals diverge, but as a whole, the integral converges. The only way I have been able to solve this is via Walfram Alpha and only with numbers--that is, replacing $z^2$ by 4 say and trying to figure out what goes where in the final answer.
I would love for someone to guide me as to how I can solve this integral exactly on paper. Additionally, could someone explain why the integral diverges when analyzed separately compared to when analyzed as a whole? This seems to break the general rule:
[Perhaps some condition such as smoothness or continuity of functions is being broken in the presented case, but I am not sure.]