George Arfken's book: Mathematical Methods for Physicists has the following problem in a chapter on contour integration:
$\displaystyle \int_0^{\infty} \dfrac{(\log x)^2}{x^2 + 1} dx$.
Their suggestion is to make the substitution $x \rightarrow z=e^t$. I'm not sure what they meant by this, but I tried making the substitution $x = e^t$, which turns the integral into:
$\displaystyle\int_{-\infty}^{\infty} \dfrac{t^2 e^t}{1+e^{2t}} dt$.
The hint is then to take the contour from -R to R, to R+$\pi i$, to -R + $\pi i$, to -R. Since this has a pole at $t = \pi i/2$, a Laurent series expansion about this point gives the residue as $i \pi^2/8$, so the contour integral equals $-\pi^3/4$.
I've been able to show that the integral along R to R + $\pi i$ and along -R + $\pi i$ to -R goes to zero by the ML inequality – the denominator grows exponentially but the numerator quadratically.
But at this point, I'm a bit lost as to what to do with the integral over Im $t = \pi$. Any help? The book gives the answer as $\pi^3 /8$.
Best Answer
Fleshing out Ragib's idea: we have the substitution $\,t\to -u+\pi i\Longrightarrow dt=-du,$ , so we put
$$f(t):=\frac{t^2e^t}{1+e^{2t}}\Longrightarrow$$
$$\Longrightarrow\int_{R+\pi i}^{-R+\pi i}f(t)\,dt=-\int_{-R}^R\frac{(u^2-2\pi iu-\pi^2)e^{-u+\pi i}}{1+e^{-2u+2\pi i}}\,du=$$
$$=\int_{-R}^R\frac{u^2e^{-u}}{1+e^{-2u}}du-2\pi i\int_{-R}^R\frac{ue^{-u}}{1+e^{-2u}}\,du-\pi^2\int_{-R}^R\frac{e^{-u}}{1+e^{-2u}}\,du$$
The first integral above is just like the one on the real axis (BTW, note the signs in front of the two last integrals, which come from the factor $\,e^{\pi i}=-1\,$).
The last integral is
$$\pi^2\int_{-R}^R\frac{d(e^{-u})}{1+e^{-2u}}=\left.\pi^2\arctan e^{-u}\right|_{-R}^R=$$
$$=\pi^2\left(\arctan e^{-R}-\arctan e^R\right)\xrightarrow [R\to\infty]{}\pi^2\left(0-\frac{\pi}{2}\right)=-\frac{\pi^3}{2}$$
The second integral above is zero as the integrand is just $\,\frac{\pi iu}{\cosh u}\,$ , which is an odd function...
Denoting our integral by $\, I \,$, we thus have that
$$2I-\frac{\pi ^3}{2}=-\frac{\pi^3}{4}\Longrightarrow I=\frac{\pi^3}{8}$$