I follow what you've done, but I'm still not sure where the

comes from. I suspect that it's a contour integral because of the infinite series

and the denominator of the integral gives such a nice sequence of poles along the imaginary axis. However, my complex analysis is much too rusty to actually make this work...

However, I don't want to get bogged down in the details of these particular integrals... I'm more interested in learning exactly how to attack problems such as these in general. A good start would be a book that described "Weierstrass Substitution" and similar substitutions... I didn't realize that this substitution even had a name! (My undergrad calculus textbook ran through the usual arcsin and arctan substitutions and ended there... no hint of any other useful substitutions or how to apply complex analysis to the problem of finding real integrals.)

Any suggestions?